Class Compressor

  • Direct Known Subclasses:

    public abstract class Compressor
    extends java.lang.Object

    A stateful object representing ongoing compression.

    • Constructor Detail

      • Compressor

        public Compressor()
    • Method Detail

      • close

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

        public abstract ByteString compress​(ByteString input)
        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.
      • 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.
      • flush

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