Package java.util.zip

Class InflaterInputStream

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected byte[] buf
      The input buffer used for decompression.
      protected Inflater inf
      The inflater used for this stream.
      protected int len
      The length of the buffer.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int available()
      Returns 0 when when this stream has exhausted its input; and 1 otherwise.
      void close()
      Closes the input stream.
      protected void fill()
      Fills the input buffer with data to be decompressed.
      void mark​(int readlimit)
      Marks the current position in the stream.
      boolean markSupported()
      Returns whether the receiver implements mark semantics.
      int read()
      Reads a single byte of decompressed data.
      int read​(byte[] buffer, int byteOffset, int byteCount)
      Reads up to byteCount bytes of decompressed data and stores it in buffer starting at byteOffset.
      void reset()
      This operation is not supported and throws IOException.
      long skip​(long byteCount)
      Skips up to byteCount bytes of uncompressed data.
    • Field Detail

      • inf

        protected Inflater inf
        The inflater used for this stream.
      • buf

        protected byte[] buf
        The input buffer used for decompression.
      • len

        protected int len
        The length of the buffer.
    • Constructor Detail

      • InflaterInputStream

        public InflaterInputStream​(InputStream is)
        This is the most basic constructor. You only need to pass the InputStream from which the compressed data is to be read from. Default settings for the Inflater and internal buffer are be used. In particular the Inflater expects a ZLIB header from the input stream.
        Parameters:
        is - the InputStream to read data from.
      • InflaterInputStream

        public InflaterInputStream​(InputStream is,
                                   Inflater inflater)
        This constructor lets you pass a specifically initialized Inflater, for example one that expects no ZLIB header.
        Parameters:
        is - the InputStream to read data from.
        inflater - the specific Inflater for decompressing data.
      • InflaterInputStream

        public InflaterInputStream​(InputStream is,
                                   Inflater inflater,
                                   int bufferSize)
        This constructor lets you specify both the Inflater as well as the internal buffer size to be used.
        Parameters:
        is - the InputStream to read data from.
        inflater - the specific Inflater for decompressing data.
        bufferSize - the size to be used for the internal buffer.