Class LZFCompressingInputStream

java.lang.Object
java.io.InputStream
com.ning.compress.lzf.LZFCompressingInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class LZFCompressingInputStream extends InputStream
Decorator InputStream implementation used for reading uncompressed data and compressing it on the fly, such that reads return compressed data. It is reverse of LZFInputStream (which instead uncompresses data).
See Also:
  • Field Details

    • _recycler

      private final BufferRecycler _recycler
    • _encoder

      private ChunkEncoder _encoder
    • _inputStream

      protected final InputStream _inputStream
      Stream used for reading data to be compressed
    • _inputStreamClosed

      protected boolean _inputStreamClosed
      Flag that indicates if we have already called 'inputStream.close()' (to avoid calling it multiple times)
    • _cfgFullReads

      protected boolean _cfgFullReads
      Flag that indicates whether we force full reads (reading of as many bytes as requested), or 'optimal' reads (up to as many as available, but at least one). Default is false, meaning that 'optimal' read is used.
    • _inputBuffer

      protected byte[] _inputBuffer
      Buffer in which uncompressed input is first read, before getting encoded in _encodedBytes.
    • _encodedBytes

      protected byte[] _encodedBytes
      Buffer that contains compressed data that is returned to readers.
    • _bufferPosition

      protected int _bufferPosition
      The current position (next char to output) in the uncompressed bytes buffer.
    • _bufferLength

      protected int _bufferLength
      Length of the current uncompressed bytes buffer
    • _readCount

      protected int _readCount
      Number of bytes read from the underlying _inputStream
  • Constructor Details

  • Method Details