Interface ICompressor<T extends Buffer>

Type Parameters:
T - The generic type of NIO buffer on which this compressor operates.
All Known Implementing Classes:
GZip2Compressor, GZip2Compressor.ByteGZip2Compressor, GZip2Compressor.DoubleGZip2Compressor, GZip2Compressor.FloatGZip2Compressor, GZip2Compressor.IntGZip2Compressor, GZip2Compressor.LongGZip2Compressor, GZip2Compressor.ShortGZip2Compressor, GZipCompressor, GZipCompressor.ByteGZipCompressor, GZipCompressor.DoubleGZipCompressor, GZipCompressor.FloatGZipCompressor, GZipCompressor.IntGZipCompressor, GZipCompressor.LongGZipCompressor, GZipCompressor.ShortGZipCompressor, HCompressor, HCompressor.ByteHCompressor, HCompressor.DoubleHCompressor, HCompressor.FloatHCompressor, HCompressor.IntHCompressor, HCompressor.ShortHCompressor, NoCompressCompressor, NoCompressCompressor.ByteNoCompressCompressor, NoCompressCompressor.DoubleNoCompressCompressor, NoCompressCompressor.FloatNoCompressCompressor, NoCompressCompressor.IntNoCompressCompressor, NoCompressCompressor.LongNoCompressCompressor, NoCompressCompressor.ShortNoCompressCompressor, PLIOCompress.BytePLIOCompressor, PLIOCompress.IntPLIOCompressor, PLIOCompress.ShortPLIOCompressor, QuantizeProcessor.DoubleQuantCompressor, QuantizeProcessor.FloatQuantCompressor, RiceCompressor, RiceCompressor.ByteRiceCompressor, RiceCompressor.DoubleRiceCompressor, RiceCompressor.FloatRiceCompressor, RiceCompressor.IntRiceCompressor, RiceCompressor.ShortRiceCompressor

public interface ICompressor<T extends Buffer>
(for internal use) Compressor that can compress a Buffer into a ByteBuffer and vize versa. the Byte buffer must have enough space allocated else an exception will be thrown.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    compress(T buffer, ByteBuffer compressed)
    compress the buffer into the byte buffer.
    void
    decompress(ByteBuffer compressed, T buffer)
    Decompress the byte buffer and restore the buffer from it, again enough space must already be allocated.
  • Method Details

    • compress

      boolean compress(T buffer, ByteBuffer compressed)
      compress the buffer into the byte buffer. Attention enough space must already be allocated.
      Parameters:
      buffer - the buffer to compress.
      compressed - the compressed data
      Returns:
      true if the compression succeeded.
    • decompress

      void decompress(ByteBuffer compressed, T buffer)
      Decompress the byte buffer and restore the buffer from it, again enough space must already be allocated.
      Parameters:
      compressed - the compressed data
      buffer - the buffer to fill with the uncompressed data.