public enum DecodingStrategy extends Enum<DecodingStrategy>
Serialization instances. This list
(indirectly) defines a sequence of signatures that we attempt to
match (in order) against a byte array header, and the associated
charset we should use if a match is found.| Enum Constant and Description |
|---|
SIG_REQ |
UTF16_DEFAULT |
UTF32_DEFAULT |
UTF8_DEFAULT |
| Modifier and Type | Method and Description |
|---|---|
String |
decode(byte[] data)
Decodes the given byte array using the charset paired to a
signature (among the signature/charset pairs within the
receiver's serializations) that matches the array header, and
returns the result.
|
SignatureCharset |
getPrefixMatch(byte[] data)
Checks whether any of the signatures among the
signature/charset pairs within the receiver's serializations
matches the header of the given byte array, and returns the
matching pair.
|
Serialization[] |
getSerializations()
Returns the receiver's serializations.
|
static DecodingStrategy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DecodingStrategy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DecodingStrategy UTF8_DEFAULT
public static final DecodingStrategy UTF16_DEFAULT
public static final DecodingStrategy UTF32_DEFAULT
public static final DecodingStrategy SIG_REQ
public static DecodingStrategy[] values()
for (DecodingStrategy c : DecodingStrategy.values()) System.out.println(c);
public static DecodingStrategy valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant
with the specified nameNullPointerException - if the argument is nullpublic Serialization[] getSerializations()
public SignatureCharset getPrefixMatch(byte[] data)
data - The byte array.public String decode(byte[] data) throws I18NException
data - The byte array, which may be null.I18NException - Thrown if no match can be found, or if
the JVM does not support the charset of the matching
signature/charset pair.Copyright © 2015. All Rights Reserved.