Class ZstdCompression$

java.lang.Object
org.apache.pekko.serialization.jackson.ZstdCompression$

public class ZstdCompression$ extends Object
INTERNAL API

zstd compression of serialized payloads. zstd-jni is an optional dependency, so it is only referenced from this object and only used when zstd is configured or a zstd payload is deserialized. A missing zstd-jni (or a platform without its native library) is reported as an IllegalArgumentException rather than a LinkageError.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ZstdCompression$
    Static reference to the singleton instance of this Scala object.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    checkLevel(int level)
    Fails if zstd-jni is not available or `level` is not a valid zstd compression level.
    byte[]
    compress(byte[] bytes, int level)
     
    byte[]
    decompress(byte[] bytes, long maxDecompressedSize, String settingPath)
    Decompress a zstd payload, failing with an IllegalArgumentException once it would exceed maxDecompressedSize bytes, so a small payload cannot expand without limit.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MODULE$

      public static final ZstdCompression$ MODULE$
      Static reference to the singleton instance of this Scala object.
  • Constructor Details

    • ZstdCompression$

      public ZstdCompression$()
  • Method Details

    • checkLevel

      public void checkLevel(int level)
      Fails if zstd-jni is not available or `level` is not a valid zstd compression level.
    • compress

      public byte[] compress(byte[] bytes, int level)
    • decompress

      public byte[] decompress(byte[] bytes, long maxDecompressedSize, String settingPath)
      Decompress a zstd payload, failing with an IllegalArgumentException once it would exceed maxDecompressedSize bytes, so a small payload cannot expand without limit. A negative maxDecompressedSize applies no limit. settingPath is named in the error message.