6

I'm trying to decompress a .zst file the following way :

public byte[] decompress() {
byte[] compressedBytes = Files.readAllBytes(Paths.get(PATH_TO_ZST));
final long size = Zstd.decompressedSize(compressedBytes);
return Zstd.decompress(compressedBytes, (int)size);
}

and I'm running into this :

com.github.luben.zstd.ZstdException: Unknown frame descriptor [java] com.github.luben.zstd.ZstdDecompressCtx.decompressByteArray(ZstdDecompressCtx.java:157) [java] com.github.luben.zstd.ZstdDecompressCtx.decompress(ZstdDecompressCtx.java:214) [java]

Has anyone faced something similar? Thanks!

0

2 Answers 2

1

That error means zstd doesn't recognize the first 4 bytes of the frame. This can be because either:

  1. The data is not in zstd format,
  2. There is excess data at the end of the zstd frame.

You'll also want to check the output of Zstd.decompressedSize() for 0, which means the frame is corrupted, or the size wasn't present in the frame header. See the documentation.

Sign up to request clarification or add additional context in comments.

2 Comments

This does not help. i am also facing this error. i did compression using zstd and then i also checked decompressionSize which returns original size from the header which gave the right number. then i tried to decompress and that is when i get the error stating unknown frame descriptor.
I faced the same issue, i had added datatype as text in my script. should be BYTEA for postgres
0
public byte[] decompress() {
     byte[] compressedBytes = Files.readAllBytes(Paths.get(PATH_TO_ZST));
     final long size = Zstd.decompressedSize(compressedBytes);
     byte[] deCompressedBytes = new byte[size];
     Zstd.decompress(deCompressedBytes,compressedBytes);
     return deCompressedBytes;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.