Package com.amazon.ion.util
Enum Class GzipStreamInterceptor
- All Implemented Interfaces:
InputStreamInterceptor,Serializable,Comparable<GzipStreamInterceptor>,Constable
public enum GzipStreamInterceptor
extends Enum<GzipStreamInterceptor>
implements InputStreamInterceptor
The interceptor for GZIP streams. This is a singleton that may be accessed using
INSTANCE.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionThe name of the format the interceptor recognizes.booleanisMatch(byte[] candidate, int offset, int length) Determines whether the given candidate byte sequence matches this format.newInputStream(InputStream interceptedStream) Creates a new InputStream that transforms the bytes in the given InputStream into valid text or binary Ion.intThe 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.static GzipStreamInterceptorReturns the enum constant of this class with the specified name.static GzipStreamInterceptor[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
formatName
Description copied from interface:InputStreamInterceptorThe name of the format the interceptor recognizes.- Specified by:
formatNamein interfaceInputStreamInterceptor- Returns:
- a constant String.
-
numberOfBytesNeededToDetermineMatch
public int numberOfBytesNeededToDetermineMatch()Description copied from interface:InputStreamInterceptorThe 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 andInputStreamInterceptor.isMatch(byte[], int, int)will not be called.- Specified by:
numberOfBytesNeededToDetermineMatchin interfaceInputStreamInterceptor- Returns:
- the length in bytes.
-
isMatch
public boolean isMatch(byte[] candidate, int offset, int length) Description copied from interface:InputStreamInterceptorDetermines whether the given candidate byte sequence matches this format.- Specified by:
isMatchin interfaceInputStreamInterceptor- Parameters:
candidate- the candidate byte sequence.offset- the offset into the candidate bytes to begin matching.length- the number of bytes (beginning at 'offset') in `candidate`. Must be greater than or equal toInputStreamInterceptor.numberOfBytesNeededToDetermineMatch().- Returns:
- true if the candidate byte sequence matches; otherwise, false.
-
newInputStream
Description copied from interface:InputStreamInterceptorCreates a new InputStream that transforms the bytes in the given InputStream into valid text or binary Ion.- Specified by:
newInputStreamin interfaceInputStreamInterceptor- Parameters:
interceptedStream- the stream containing bytes in this format.- Returns:
- a new InputStream.
- Throws:
IOException- if thrown when constructing the new InputStream.
-