zstd-jni icon indicating copy to clipboard operation
zstd-jni copied to clipboard

Support magicless frame

Open rdicroce opened this issue 4 years ago • 3 comments

I'm using this in a messaging scenario where I already have a flag to tell me which compression algorithm is being used. So Zstd's 4-byte magic identifier is just wasting bytes and I'd like to omit it. The Zstd API already supports doing this (see the API docs about ZSTD_DCtx_setFormat and ZSTD_f_zstd1_magicless) so the JNI wrapper just needs to expose that functionality.

rdicroce avatar Nov 23 '20 13:11 rdicroce

Hi, may be in the future - these params are still experimental.

luben avatar Nov 23 '20 14:11 luben

Are you saying you won't implement any API labeled as experimental? Because the Zstd API docs say that some experimental APIs are "planned to remain in the static_only section indefinitely" and I suspect magicless is one of them. It has been available for over 3 years, and the stance of the Zstd maintainers seems to be that they don't want to make magicless frames too easy to obtain. Labeling it as an "experimental" API is presumably part of that. But I doubt they'll ever remove it altogether, because there are certain situations (like mine) where it's useful.

rdicroce avatar Nov 23 '20 14:11 rdicroce

Agree that it may be useful. Currently I don't compile it with STATIC_ONLY and this may need some substantial change to the build process. I will explore it

luben avatar Nov 23 '20 16:11 luben