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

public final Enum GzipStreamInterceptor

extends Enum<GzipStreamInterceptor>
implements InputStreamInterceptor
Class Inheritance
All Implemented Interfaces
com.amazon.ion.util.InputStreamInterceptor
Imports
java.io.IOException, .InputStream, java.util.zip.GZIPInputStream

The interceptor for GZIP streams. This is a singleton that may be accessed using INSTANCE.

Field Summary

Modifier and TypeField and Description
private static final byte[]
public static final GzipStreamInterceptor

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
formatName()

Implements com.amazon.ion.util.InputStreamInterceptor.formatName.

The name of the format the interceptor recognizes.

public boolean
isMatch(byte[]
the candidate byte sequence.
candidate
,
int
the offset into the candidate bytes to begin matching.
offset
,
int
the number of bytes (beginning at 'offset') in `candidate`. Must be greater than or equal to numberOfBytesNeededToDetermineMatch().
length
)

Implements com.amazon.ion.util.InputStreamInterceptor.isMatch.

Determines whether the given candidate byte sequence matches this format.

public InputStream
newInputStream(InputStream
the stream containing bytes in this format.
interceptedStream
)

Implements com.amazon.ion.util.InputStreamInterceptor.newInputStream.

Creates a new InputStream that transforms the bytes in the given InputStream into valid text or binary Ion.

public int
numberOfBytesNeededToDetermineMatch()

Implements com.amazon.ion.util.InputStreamInterceptor.numberOfBytesNeededToDetermineMatch.

The number of bytes required to be read from the beginning of the stream in order to determine whether it matches the format relevant to this interceptor.

public static GzipStreamInterceptor
public static GzipStreamInterceptor[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

GZIP_HEADERback to summary
private static final byte[] GZIP_HEADER
INSTANCEback to summary
public static final GzipStreamInterceptor INSTANCE

Constructor Detail

GzipStreamInterceptorback to summary
private GzipStreamInterceptor()

Method Detail

formatNameback to summary
public String formatName()

Implements com.amazon.ion.util.InputStreamInterceptor.formatName.

Doc from com.amazon.ion.util.InputStreamInterceptor.formatName.

The name of the format the interceptor recognizes.

Returns:String

a constant String.

Annotations
@Override
isMatchback to summary
public boolean isMatch(byte[] candidate, int offset, int length)

Implements com.amazon.ion.util.InputStreamInterceptor.isMatch.

Doc from com.amazon.ion.util.InputStreamInterceptor.isMatch.

Determines whether the given candidate byte sequence matches this format.

Parameters
candidate:byte[]

the candidate byte sequence.

offset:int

the offset into the candidate bytes to begin matching.

length:int

the number of bytes (beginning at 'offset') in `candidate`. Must be greater than or equal to numberOfBytesNeededToDetermineMatch().

Returns:boolean

true if the candidate byte sequence matches; otherwise, false.

Annotations
@Override
newInputStreamback to summary
public InputStream newInputStream(InputStream interceptedStream) throws IOException

Implements com.amazon.ion.util.InputStreamInterceptor.newInputStream.

Doc from com.amazon.ion.util.InputStreamInterceptor.newInputStream.

Creates a new InputStream that transforms the bytes in the given InputStream into valid text or binary Ion.

Parameters
interceptedStream:InputStream

the stream containing bytes in this format.

Returns:InputStream

a new InputStream.

Annotations
@Override
Exceptions
IOException:
if thrown when constructing the new InputStream.
numberOfBytesNeededToDetermineMatchback to summary
public int numberOfBytesNeededToDetermineMatch()

Implements com.amazon.ion.util.InputStreamInterceptor.numberOfBytesNeededToDetermineMatch.

Doc from com.amazon.ion.util.InputStreamInterceptor.numberOfBytesNeededToDetermineMatch.

The number of bytes required to be read from the beginning of the stream in order to determine whether it matches the format relevant to this interceptor. If a stream contains fewer than the number of bytes returned by this method, then this interceptor will not be considered a match and isMatch(byte[], int, int) will not be called.

Returns:int

the length in bytes.

Annotations
@Override
valueOfback to summary
public static GzipStreamInterceptor valueOf(String name)
valuesback to summary
public static GzipStreamInterceptor[] values()