luben / zstd-jni

JNI binding for Zstd
Other
809 stars 165 forks source link

Relax the requirement for source and target ByteBuffer in ZstdBufferDecompressingStream #258

Closed divijvaidya closed 1 year ago

divijvaidya commented 1 year ago

resolves https://github.com/luben/zstd-jni/issues/252

Motivation

At https://github.com/luben/zstd-jni/blob/master/src/main/java/com/github/luben/zstd/ZstdBufferDecompressingStreamNoFinalizer.java#L47-L48 extractArray() ensures that the buffer.arrayOffset() != 0. However, that is not a strict requirement for ZstdBufferDecompressingStream since it works with the case [1] where ByteBuffer may have a non-zero position.

Change

Testing

luben commented 1 year ago

Thanks for the contribution