Interface ByteBuffDecompressor

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
ZstdByteBuffDecompressor

@Private public interface ByteBuffDecompressor extends Closeable
Specification of a ByteBuff-based decompressor, which can be more efficient than the stream-based Decompressor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Signals of these two particular ByteBuffs are compatible with this decompressor.
    int
    decompress(ByteBuff output, ByteBuff input, int inputLen)
    Fills the ouput buffer with uncompressed data.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • decompress

      int decompress(ByteBuff output, ByteBuff input, int inputLen) throws IOException
      Fills the ouput buffer with uncompressed data. Always call canDecompress(ByteBuff, ByteBuff) first to check if this decompressor can handle your input and output buffers.
      Returns:
      The actual number of bytes of uncompressed data.
      Throws:
      IOException
    • canDecompress

      boolean canDecompress(ByteBuff output, ByteBuff input)
      Signals of these two particular ByteBuffs are compatible with this decompressor. ByteBuffs can have one or multiple backing buffers, and each of these may be stored in heap or direct memory. Different ByteBuffDecompressors may be able to handle different combinations of these, so always check.