You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have an input ByteBuffer with some datas i want to decompress.
I know i can decompress 65536 bytes but i don't know how many bytes in input buffer will be needed for this (but i know my input buffer contains enough data to achieve it and can decompress exactly 64K bytes)
So, i call ZstdDecompressor.decompress( ByteBufffer input , ByteBuffer output )
With exactly 65536 bytes availables to output
This method call io.airlift.compress.MalformedInputException: Output buffer too small: offset=999 because it try to decompress more than 65536 bytes.
It's because after a frame, it reach 65536 output bytes but continue because input bytes are remaining
In ZstdFrameDecompressor i would have a code like this:
Hi,
I have an input
ByteBuffer
with some datas i want to decompress.I know i can decompress 65536 bytes but i don't know how many bytes in input buffer will be needed for this (but i know my input buffer contains enough data to achieve it and can decompress exactly 64K bytes)
So, i call
ZstdDecompressor.decompress( ByteBufffer input , ByteBuffer output )
With exactly 65536 bytes availables to output
This method call
io.airlift.compress.MalformedInputException: Output buffer too small: offset=999
because it try to decompress more than 65536 bytes.It's because after a frame, it reach 65536 output bytes but continue because input bytes are remaining
In
ZstdFrameDecompressor
i would have a code like this:150: while( input < inputLimit && output < outputLimit ) {
But also in
ZstdDecompressor
(like line 101), we should update position on output buffer and also on input bufferIf the
outputlimit
is not perfectly aligned with a frame, we should continue to have theMalformedInputException
Best regards,
Sébastien.
The text was updated successfully, but these errors were encountered: