airlift / aircompressor

A port of Snappy, LZO, LZ4, and Zstandard to Java
Apache License 2.0
562 stars 111 forks source link

Do not reuse ZstdFrameDecompressor in ZstdDecompressor #139

Closed wendigo closed 2 years ago

wendigo commented 2 years ago

ZstdFrameDecompressor is not thread safe.

martint commented 2 years ago

That's intentional. ZstdDecompressor is not thread safe, but instances can be used multiple times. ZstdFrameDecompressor has internal buffers that should be reused to avoid unnecessary allocations when ZstdDecompressor.decompress() gets called multiple times.