Class Compressor

  • Direct Known Subclasses:
    DeflateCompressor

    public abstract class Compressor
    extends java.lang.Object
    Compresses the given input and returns compressed data. The implementation can and will choose to buffer output data to improve compression. Use flush or compressAndFlush to make sure that all input data has been compressed and pending output data has been returned.
    • Constructor Detail

      • Compressor

        public Compressor()
    • Method Detail

      • close

        public abstract void close()
        Make sure any resources have been released
      • compressAndFinish

        public abstract ByteString compressAndFinish​(ByteString input)
        Combines `compress` + `finish`
      • compressAndFlush

        public abstract ByteString compressAndFlush​(ByteString input)
        Combines `compress` + `flush`
      • finish

        public abstract ByteString finish()
        Closes this compressed stream and return the remaining compressed data. After calling this method, this Compressor cannot be used any further.
        Returns:
        (undocumented)
      • flush

        public abstract ByteString flush()
        Flushes any output data and returns the currently remaining compressed data.
        Returns:
        (undocumented)