I'm a little concerned if another thread writes the bufferPacker right after the following line, the new records would be cleared:
```
gzipOutputStream.write(bufferPacker.toByteArray());
```
How about including the above line in this 'synchronized' block?