Top Description Fields Constructors Methods
com.amazon.ion.util

pack-priv Class GzipOrRawInputStream

extends FilterInputStream
Class Inheritance
Imports
java.io.FilterInputStream, .IOException, .InputStream, .PushbackInputStream, java.util.Arrays, java.util.zip.GZIPInputStream

Represents an InputStream that may be GZIP compressed or not. This stream assumes that the GZIP header is unique to the raw content. That is, one should not use this on a stream that may have raw data in the begining of the stream that collides with the GZIP header. In the case of Ion binary, Ion text, and XML, a GZIP stream is unambiguous from them.

Field Summary

Modifier and TypeField and Description
pack-priv static final byte[]
GZIP_HEADER

GZIP magic cookie.

Inherited from java.io.FilterInputStream:
in

Constructor Summary

AccessConstructor and Description
pack-priv
GzipOrRawInputStream(final InputStream
The input stream to wrap.
raw
)

Wraps the given stream determining based on the GZIP header whether or not the stream is compressed and should be dynamically de-compressed.

pack-priv
GzipOrRawInputStream(final InputStream
The input stream to wrap.
raw
,
final int
internal buffer size to use for decompression.
bufferSize
)

Wraps the given stream determining based on the GZIP header whether or not the stream is compressed and should be dynamically de-compressed.

Method Summary

Inherited from java.io.FilterInputStream:
availableclosemarkmarkSupportedreadreadreadresetskip

Field Detail

GZIP_HEADERback to summary
pack-priv static final byte[] GZIP_HEADER

GZIP magic cookie.

Constructor Detail

GzipOrRawInputStreamback to summary
pack-priv GzipOrRawInputStream(final InputStream raw) throws IOException

Wraps the given stream determining based on the GZIP header whether or not the stream is compressed and should be dynamically de-compressed.

Parameters
raw:InputStream

The input stream to wrap.

Exceptions
IOException:
Thrown if there is a problem reading from the underlying stream.
GzipOrRawInputStreamback to summary
pack-priv GzipOrRawInputStream(final InputStream raw, final int bufferSize) throws IOException

Wraps the given stream determining based on the GZIP header whether or not the stream is compressed and should be dynamically de-compressed.

Parameters
raw:InputStream

The input stream to wrap.

bufferSize:int

internal buffer size to use for decompression.

Exceptions
IOException:
Thrown if there is a problem reading from the underlying stream.