Package com.oss.util
Class DecompressInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.util.zip.InflaterInputStream
com.oss.util.DecompressInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
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 Summary
ConstructorDescriptionConstructs DecompressInputStream from an InputStream with the default decompressor and buffer size.DecompressInputStream
(InputStream in, Inflater inflater) Constructs DecompressInputStream from an InputStream with the specified decompressor and default buffer size.DecompressInputStream
(InputStream in, Inflater inflater, int size) Constructs DecompressInputStream from an InputStream with the specified decompressor and buffer size. -
Method Summary
Modifier and TypeMethodDescriptionint
read
(byte[] b, int off, int len) Reads uncompressed data into an array of bytes.void
setSizeoflong
(int value) Sets the mSizeoflong to the specified value if the compression have been by ASN1/C tools.Methods inherited from class java.util.zip.InflaterInputStream
available, close, mark, markSupported, read, reset, skip
Methods inherited from class java.io.FilterInputStream
read
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
DecompressInputStream
Constructs DecompressInputStream from an InputStream with the specified decompressor and buffer size.- Parameters:
in
- the input streaminflater
- the decompressorsize
- the input buffer size- Throws:
IllegalArgumentException
- if size is <= 0
-
DecompressInputStream
Constructs DecompressInputStream from an InputStream with the specified decompressor and default buffer size.- Parameters:
in
- the input streaminflater
- the decompressor
-
DecompressInputStream
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
Reads uncompressed data into an array of bytes. This method will block until some input can be decompressed.- Overrides:
read
in classInflaterInputStream
- Parameters:
b
- the buffer into which the data is readoff
- the start offset of the datalen
- 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
-