I am getting the issue while trying to decompress the LZO file using java. Below is the code and error I have pasted, can someone please help me on this
import org.anarres.lzo.*;
import java.io.*;
public class LZODecompression {
public static void main(String args[]) throws IOException {
InputStream in = new FileInputStream(new
File("/desktop/mm_impressions_101349_20220723_2022072802.txt.lzo"));
LzoAlgorithm algorithm = LzoAlgorithm.LZO1X;
LzoDecompressor decompressor = LzoLibrary.getInstance().newDecompressor(algorithm,
null);
LzoInputStream stream = new LzoInputStream(in, decompressor);
OutputStream outputStream = new FileOutputStream(new File("/Desktop/test.txt"));
int len;
byte[] bytes = new byte[1024];
while ((len = stream.read(bytes)) != -1) {
outputStream.write(bytes, 0, len);
}
outputStream.close();
stream.close();
}
}
Exception in thread "main" java.io.EOFException
at org.anarres.lzo.LzoInputStream.readBytes(LzoInputStream.java:183)
at org.anarres.lzo.LzoInputStream.readBlock(LzoInputStream.java:132)
at org.anarres.lzo.LzoInputStream.fill(LzoInputStream.java:119)
at org.anarres.lzo.LzoInputStream.read(LzoInputStream.java:102)
at org.anarres.lzo.LzoInputStream.read(LzoInputStream.java:97)
at org.example.LZODecompression.main(LZODecompression.java:37)