Ankit Chawrai
Ankit Chawrai

Reputation: 37

How do I decompress a zstd compressed payload in scala

Hi I have a payload that i need to decompress in scala

val uncompressed = "" //payload to be decompressed
val uncomprBytes = uncompressed.getBytes()
val size =  uncomprBytes.length
val decompressedStr = decompress(uncomprBytes,size)

and I'm getting following error -

Exception in thread "main" com.github.luben.zstd.ZstdException: Unknown frame descriptor
    at com.github.luben.zstd.ZstdDecompressCtx.decompressByteArray(ZstdDecompressCtx.java:157)
    at com.github.luben.zstd.ZstdDecompressCtx.decompress(ZstdDecompressCtx.java:214)
    at com.github.luben.zstd.ZstdDecompressCtx.decompress(ZstdDecompressCtx.java:219)
    at com.github.luben.zstd.Zstd.decompress(Zstd.java:1067)

I have read that there is chance payload string is missing the header data in such error.. If that's the case please let me know how to add header to payload string.

Upvotes: 0

Views: 405

Answers (0)

Related Questions