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
feat: replace raw int compression level with ZstdCompressionLevel
Introduces ZstdCompressionLevel, a record wrapping the compression level as a
validated int, checked in its compact constructor against
Zstd.minCompressionLevel()/maxCompressionLevel() (IllegalArgumentException if
out of range) rather than deferring to native clamping/errors. The accepted
range is queried from libzstd once and cached, since it never changes for the
life of the process. Ships DEFAULT/FASTEST/MAX constants for the common
cases; construct directly (new ZstdCompressionLevel(n)) for any other level —
there is no separate of(int) factory, since a public record's canonical
constructor can't be hidden anyway.
Replaces every naked int level parameter with it across Zstd,
ZstdCompressContext, ZstdCompressStream, ZstdCompressDictionary,
ZstdDictionary, and ZstdOutputStream. Zstd.min/max/defaultCompressionLevel()
keep returning int, since they're the bound queries the new type validates
against.
Breaking change; the library is pre-1.0 so no compatibility shims are added.
Closes#93.
0 commit comments