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
When streaming compression is used, the compressed frame does not include a size, and therefore ZSTD_getFrameContentSize will return ZSTD_CONTENTSIZE_UNKNOWN. Thus, the new Simple().decompress(buf) call will fail, because contentSizeImpl returns null.
However, if the caller already knows the decompressed size (by some other means), it should still be possible to use the new Simple().decompress() function. This could be achieved by passing an optional size param to the function.
Edit: I have worked around the issue by using the streaming decompress function. However I still think it would be valuable for the simple decompress function to include an optional size param.
The text was updated successfully, but these errors were encountered:
For anyone that needs this functionality, the https://github.com/foxglove/wasm-zstd library supports decompressing with a known (or upper bound) decompressed data size.
When streaming compression is used, the compressed frame does not include a size, and therefore
ZSTD_getFrameContentSize
will returnZSTD_CONTENTSIZE_UNKNOWN
. Thus, thenew Simple().decompress(buf)
call will fail, becausecontentSizeImpl
returns null.However, if the caller already knows the decompressed size (by some other means), it should still be possible to use the
new Simple().decompress()
function. This could be achieved by passing an optional size param to the function.Edit: I have worked around the issue by using the streaming decompress function. However I still think it would be valuable for the simple decompress function to include an optional size param.
The text was updated successfully, but these errors were encountered: