Closed abhisheksurve45 closed 2 years ago
@odaira
getting
java.io.IOException: Stream ended prematurely
at net.jpountz.lz4.LZ4FrameInputStream.readInt(LZ4FrameInputStream.java:245) ~[lz4-java-1.8.0.jar!/:?]
at net.jpountz.lz4.LZ4FrameInputStream.readBlock(LZ4FrameInputStream.java:259) ~[lz4-java-1.8.0.jar!/:?]
at net.jpountz.lz4.LZ4FrameInputStream.read(LZ4FrameInputStream.java:353) ~[lz4-java-1.8.0.jar!/:?]
at java.io.InputStream.transferTo(Unknown Source) ~[?:?]
with LZ4FrameInputStream
from https://mvnrepository.com/artifact/org.lz4/lz4-java/1.8.0
This is solved
public byte[] decompress(byte[] input) throws IOException {
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
InputStream inputStream = new ByteArrayInputStream(input)) {
try (InputStream snappyInputStream = new LZ4FrameInputStream(inputStream, false)) {
IOUtils.copy(snappyInputStream, outputStream);
}
return outputStream.toByteArray();
}
}
Hi team,
I'm getting
Premature end of data
while decompressing the byte arrayDecompress function:
Compress function:
This is being used with JdkSerializationRedisSerializer
Serialization working fine with snappy / zstd
Snappy:
Apache common utils version: https://mvnrepository.com/artifact/org.apache.commons/commons-compress/1.21
Same issue is happening with
LZ4FrameInputStream
from https://mvnrepository.com/artifact/org.lz4/lz4-java/1.8.0Please let me know if anything else required to debug the same. Thanks again.