Package com.oss.util

Class DecompressInputStream

All Implemented Interfaces:
Closeable, AutoCloseable

public class DecompressInputStream extends InflaterInputStream
This class class provides the same functionality as the InflaterInputStream but skips the encoding prefix before data decompression.
Since:
ASN.1/Java 5.1.0
  • Constructor Details

    • DecompressInputStream

      public DecompressInputStream(InputStream in, Inflater inflater, int size)
      Constructs DecompressInputStream from an InputStream with the specified decompressor and buffer size.
      Parameters:
      in - the input stream
      inflater - the decompressor
      size - the input buffer size
      Throws:
      IllegalArgumentException - if size is <= 0
    • DecompressInputStream

      public DecompressInputStream(InputStream in, Inflater inflater)
      Constructs DecompressInputStream from an InputStream with the specified decompressor and default buffer size.
      Parameters:
      in - the input stream
      inflater - the decompressor
    • DecompressInputStream

      public DecompressInputStream(InputStream in)
      Constructs DecompressInputStream from an InputStream with the default decompressor and buffer size.
      Parameters:
      in - the input stream
  • Method Details

    • setSizeoflong

      public void setSizeoflong(int value)
      Sets the mSizeoflong to the specified value if the compression have been by ASN1/C tools.
      Parameters:
      value - - the sizeof(long)
    • read

      public int read(byte[] b, int off, int len) throws IOException
      Reads uncompressed data into an array of bytes. This method will block until some input can be decompressed.
      Overrides:
      read in class InflaterInputStream
      Parameters:
      b - the buffer into which the data is read
      off - the start offset of the data
      len - the maximum number of bytes read
      Returns:
      the actual number of bytes read, or -1 if the end of the compressed input is reached or a preset dictionary is needed
      Throws:
      IOException - if an I/O error has occurred