lz4 / lz4-java

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

How to decopress large LZ4 files? #198

Closed lt3stus3el closed 1 year ago

lt3stus3el commented 1 year ago

I want to decompress large LZ4 file using java. The problem is that I cannot read the whole file into byte array. Is it possible to read some buffer (1024 bytes for example?) and then decompress each byte array and append to the output?

lt3stus3el commented 1 year ago

Solved. It was in README. Oh!

LZ4FrameInputStream inStream = new LZ4FrameInputStream(new FileInputStream(inputFile));
FileOutputStream fos = new FileOutputStream(outputFile);
inStream.transferTo(fos);