Class ZstdCodec

java.lang.Object
io.deephaven.grpc.compression.ZstdCodec
All Implemented Interfaces:
io.grpc.Codec, io.grpc.Compressor, io.grpc.Decompressor

public final class ZstdCodec extends Object implements io.grpc.Codec
A gRPC Codec for the zstd message encoding, backed by zstd-jni streams at zstd's default compression level. gRPC opens a stream for every message, so the streams take their buffers from zstd-jni's shared RecyclingBufferPool rather than allocating new ones each time.
  • Field Details

    • ENCODING

      public static final String ENCODING
      The gRPC message encoding name, as it appears in grpc-encoding and grpc-accept-encoding.
      See Also:
    • INSTANCE

      public static final ZstdCodec INSTANCE
  • Method Details

    • getMessageEncoding

      public String getMessageEncoding()
      Specified by:
      getMessageEncoding in interface io.grpc.Compressor
      Specified by:
      getMessageEncoding in interface io.grpc.Decompressor
    • compress

      public OutputStream compress(OutputStream os) throws IOException
      Specified by:
      compress in interface io.grpc.Compressor
      Throws:
      IOException
    • decompress

      public InputStream decompress(InputStream is) throws IOException
      Specified by:
      decompress in interface io.grpc.Decompressor
      Throws:
      IOException