0

I'm getting error "Corrupted input, selectorMtf value too big" when trying to decompress the string compressed by bzip2. Below is my decompress java code

private void decompress() throws IOException {
    InputStream fin = Files.newInputStream(Paths.get("C:\\Comp.txt"));
    BufferedInputStream in = new BufferedInputStream(fin);
    OutputStream out = Files.newOutputStream(Paths.get("C:\\Dec.txt"));
    BZip2CompressorInputStream bzIn = new BZip2CompressorInputStream(in);
    final byte[] buffer = new byte[9];
    int n = 0;
    while (-1 != (n = bzIn.read(buffer))) {
        out.write(buffer, 0, n);
    }
    out.close();
    bzIn.close();
}

The error happens at this line

BZip2CompressorInputStream bzIn = new BZip2CompressorInputStream(in);

Anyone knows how to fix this error please ?

Olivier
  • 13,283
  • 1
  • 8
  • 24
Kingo Mostafa
  • 357
  • 5
  • 21

0 Answers0