public enum GzipStreamInterceptor extends java.lang.Enum<GzipStreamInterceptor> implements InputStreamInterceptor
INSTANCE.| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
formatName()
The name of the format the interceptor recognizes.
|
boolean |
isMatch(byte[] candidate,
int offset,
int length)
Determines whether the given candidate byte sequence matches this format.
|
java.io.InputStream |
newInputStream(java.io.InputStream interceptedStream)
Creates a new InputStream that transforms the bytes in the given InputStream into valid text or binary Ion.
|
int |
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.
|
static GzipStreamInterceptor |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static GzipStreamInterceptor[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final GzipStreamInterceptor INSTANCE
public static GzipStreamInterceptor[] values()
for (GzipStreamInterceptor c : GzipStreamInterceptor.values()) System.out.println(c);
public static GzipStreamInterceptor valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic java.lang.String formatName()
InputStreamInterceptorformatName in interface InputStreamInterceptorpublic int numberOfBytesNeededToDetermineMatch()
InputStreamInterceptorInputStreamInterceptor.isMatch(byte[], int, int) will not be called.numberOfBytesNeededToDetermineMatch in interface InputStreamInterceptorpublic boolean isMatch(byte[] candidate,
int offset,
int length)
InputStreamInterceptorisMatch in interface InputStreamInterceptorcandidate - 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 to
InputStreamInterceptor.numberOfBytesNeededToDetermineMatch().public java.io.InputStream newInputStream(java.io.InputStream interceptedStream)
throws java.io.IOException
InputStreamInterceptornewInputStream in interface InputStreamInterceptorinterceptedStream - the stream containing bytes in this format.java.io.IOException - if thrown when constructing the new InputStream.