lz4 / lz4-java

LZ4 compression for Java
Apache License 2.0
1.09k stars 248 forks source link

Exception in thread "main" net.jpountz.lz4.LZ4Exception: Malformed input at 16 #208

Open tejaspatel1990 opened 1 year ago

tejaspatel1990 commented 1 year ago

I am getting this exception while decompressing my data. This doesn't happen every time, and I am not able to reproduce this issue on my local. But we see this issue on one of our environment using 1.5.0 lz4 version for compression while 1.8.0 is used for decompression. Following is the error I get :

Exception in thread "main" net.jpountz.lz4.LZ4Exception: Malformed input at 16 at net.jpountz.lz4.LZ4JavaUnsafeFastDecompressor.decompress(LZ4JavaUnsafeFastDecompressor.java:78)

Compression code :

String encodedData = "Json" // Json string

    byte[] byteArray = encodedData.getBytes(StandardCharsets.UTF_8);

net.jpountz.lz4.LZ4Compressor compressor = factory.fastCompressor(); return compressor.compress(data);

Decompression code:

LZ4FastDecompressor decompressor = factory.fastDecompressor(); byte[] decompressData = new byte[decompressedLength]; decompressor.decompress(compressedData, 0, decompressData, 0, decompressedLength);

Can you some one please help me to first reproduce this issue secondly to solve it.

tejaspatel1990 commented 1 year ago

@ido @JoshRosen @clockfort : Can you please help

tejaspatel1990 commented 1 year ago

odaira

tejaspatel1990 commented 1 year ago

@odaira