|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<DecodingStrategy>
org.marketcetera.util.unicode.DecodingStrategy
public enum DecodingStrategy
A list of one or more 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 Summary | |
|---|---|
SIG_REQ
|
|
UTF16_DEFAULT
|
|
UTF32_DEFAULT
|
|
UTF8_DEFAULT
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final DecodingStrategy UTF8_DEFAULT
public static final DecodingStrategy UTF16_DEFAULT
public static final DecodingStrategy UTF32_DEFAULT
public static final DecodingStrategy SIG_REQ
| Method Detail |
|---|
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 name
NullPointerException - 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||