Releases: dfa1/zstd-java
Releases · dfa1/zstd-java
v0.4
Added
Zstd.versionNumber()— the linked zstd version as a single integer
(MAJOR * 10000 + MINOR * 100 + PATCH, e.g.10507for1.5.7), for
programmatic version checks alongsideversion().
Changed
ZstdSkippableContentis now a true immutable value: it defensively copies its
bytes on the way in and out, and compares by content
(equals/hashCode/toStringover the payload, not array identity).- Public methods fail fast with a named
NullPointerExceptionon nullbyte[],
dictionary, or sample arguments, instead of an opaque failure deep in native
code. Streams are documented as not thread-safe; digested dictionaries
(ZstdCompressDict/ZstdDecompressDict) as immutable and safe to share.
Fixed
- A streaming wrapper that failed partway through construction (e.g. an invalid
parameter or dictionary) leaked the native context. The context is now freed
on every constructor error path.
Security
- The bundled library is extracted into a directory created owner-only
(rwx------) atomically at creation, not just by default. The third-party
setup-zigCI action is pinned to a full commit SHA.
v0.3
Changed
zstd-platformis now an ordinary (empty) jar instead of apomaggregator:
depend on it like any other artifact — drop the<type>pom</type>you needed
before. It still transitively pulls the bindings plus all six native libraries.
Security
- Native loading is bundled-only. Removed the
-Dzstd.lib.pathoverride —
loading a caller-supplied native library is arbitrary native code execution in
the JVM, so the loader now trusts only the artifact bundled on the classpath.
The bundled library is extracted into a private, owner-only temp directory
(closing a swap/symlink window in the shared temp root). To run a self-built
libzstd, rebuild it into the native resource jar (seedocs/how-to.md).
Fixed
ZstdSkippableContentnow compares by content:equals/hashCode/
toStringconsider the payload bytes instead of array identity.
v0.2
Added
zstd-platformaggregator artifact: one dependency pulls the bindings plus
every platform's native library, so a build runs on any OS/arch without
choosing a classifier.MemorySegmentconstructors onZstdCompressDict/ZstdDecompressDictto
digest a dictionary straight from off-heap memory (e.g. an mmap slice) with no
heapbyte[]copy.
v0.1
First release. Java 25 Foreign Function & Memory (FFM) bindings for
Zstandard 1.5.7, built hermetically from
vendored source with zig cc (no JNI, no prebuilt binaries). 68 of the public
zstd symbols are bound; see docs/supported.md.
Added
- One-shot compression/decompression over
byte[]and zero-copyMemorySegment
(Zstd,ZstdCompressCtx,ZstdDecompressCtx). - Dictionaries: training (
ZDICT_trainFromBuffer, COVER / fast-COVER optimisers,
finalizeDictionary), digestedZstdCompressDict/ZstdDecompressDict,
dictionary ids and header size. - Streaming:
ZstdOutputStream/ZstdInputStream(java.io) and a zero-copy
MemorySegmentdriver (ZstdCompressStream/ZstdDecompressStream), with
dictionaries,pledgedSrcSize, and liveprogress(). - All advanced parameters (
ZstdCompressParameter/ZstdDecompressParameter)
with bounds queries; checksum, long-distance matching, window log, etc. - Frame inspection (
ZstdFrame): header, content/compressed size, dictionary id,
skippable frames. - Typed errors (
ZstdException.code()/ZstdErrorCode) and memory accounting
(sizeOf(),Zstd.estimate*Size). - Native artifacts for macOS, Linux and Windows on x86_64 and aarch64,
cross-compiled from a single host withzig cc. - Format-compatibility tests against the reference zstd-jni binding.