>..counts compressed out bytes

..until max is reached and it's flushed and reset I think..

Have you tested it with large writes?