Skip to content

Releases: dfa1/zstd-java

v0.4

26 Jun 21:01

Choose a tag to compare

Added

  • Zstd.versionNumber() — the linked zstd version as a single integer
    (MAJOR * 10000 + MINOR * 100 + PATCH, e.g. 10507 for 1.5.7), for
    programmatic version checks alongside version().

Changed

  • ZstdSkippableContent is now a true immutable value: it defensively copies its
    bytes on the way in and out, and compares by content
    (equals / hashCode / toString over the payload, not array identity).
  • Public methods fail fast with a named NullPointerException on null byte[],
    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-zig CI action is pinned to a full commit SHA.

v0.3

26 Jun 16:33

Choose a tag to compare

Changed

  • zstd-platform is now an ordinary (empty) jar instead of a pom aggregator:
    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.path override —
    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 (see docs/how-to.md).

Fixed

  • ZstdSkippableContent now compares by content: equals / hashCode /
    toString consider the payload bytes instead of array identity.

v0.2

26 Jun 13:58

Choose a tag to compare

Added

  • zstd-platform aggregator artifact: one dependency pulls the bindings plus
    every platform's native library, so a build runs on any OS/arch without
    choosing a classifier.
  • MemorySegment constructors on ZstdCompressDict / ZstdDecompressDict to
    digest a dictionary straight from off-heap memory (e.g. an mmap slice) with no
    heap byte[] copy.

v0.1

26 Jun 13:03

Choose a tag to compare

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-copy MemorySegment
    (Zstd, ZstdCompressCtx, ZstdDecompressCtx).
  • Dictionaries: training (ZDICT_trainFromBuffer, COVER / fast-COVER optimisers,
    finalizeDictionary), digested ZstdCompressDict / ZstdDecompressDict,
    dictionary ids and header size.
  • Streaming: ZstdOutputStream / ZstdInputStream (java.io) and a zero-copy
    MemorySegment driver (ZstdCompressStream / ZstdDecompressStream), with
    dictionaries, pledgedSrcSize, and live progress().
  • 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 with zig cc.
  • Format-compatibility tests against the reference zstd-jni binding.