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.
When streaming compression is used, the compressed frame does not include a size, and therefore
ZSTD_getFrameContentSizewill returnZSTD_CONTENTSIZE_UNKNOWN. Thus, thenew Simple().decompress(buf)call will fail, becausecontentSizeImplreturns 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.