hyperxpro / Brotli4j

Brotli4j provides Brotli compression and decompression for Java.
Apache License 2.0
102 stars 35 forks source link

Encoder wrong length during `push` op #127

Closed hyperxpro closed 8 months ago

hyperxpro commented 8 months ago

Motivation:

Currently, the Java wrapper Encoder passes byte array length for finishing data encoding. This is ideal when the encoder is used with offset 0 and full length is passed but for cases where offset is passed and length is also specified, it leads to encoded data corruption.

Modification: Instead of passing byte array length to the push method, we will now pass length directly.

Result: Error-free encoding

deshanxiao commented 8 months ago

Thanks for your quick fix @hyperxpro.

BTW, Is this worthy of a new fixed version like 1.14.1?

hyperxpro commented 8 months ago

Yup, cutting v1.15.0 release now.