public enum Serialization extends Enum<Serialization>
| Enum Constant and Description |
|---|
UTF16 |
UTF16BE |
UTF16BE_REQ |
UTF16LE |
UTF16LE_REQ |
UTF32 |
UTF32BE |
UTF32BE_REQ |
UTF32LE |
UTF32LE_REQ |
UTF8 |
UTF8N |
| Modifier and Type | Method and Description |
|---|---|
static String |
decode(Serialization[] candidates,
byte[] data)
Decodes the given byte array using the charset paired to a
signature (among the pairs of the given serializations) that
matches the array header, and returns the result.
|
static SignatureCharset |
getPrefixMatch(Serialization[] candidates,
byte[] data)
Checks whether any of the signatures among the pairs of the
given serializations matches the header of the given byte
array, and returns the matching signature/charset pair.
|
SignatureCharset[] |
getSignatureCharsets()
Returns the receiver's signature/charset pairs.
|
static Serialization |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Serialization[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Serialization UTF8
public static final Serialization UTF8N
public static final Serialization UTF16
public static final Serialization UTF16BE
public static final Serialization UTF16LE
public static final Serialization UTF32
public static final Serialization UTF32BE
public static final Serialization UTF32LE
public static final Serialization UTF16BE_REQ
public static final Serialization UTF16LE_REQ
public static final Serialization UTF32BE_REQ
public static final Serialization UTF32LE_REQ
public static Serialization[] values()
for (Serialization c : Serialization.values()) System.out.println(c);
public static Serialization 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 static SignatureCharset getPrefixMatch(Serialization[] candidates, byte[] data)
candidates - The serializations.data - The byte array.public static String decode(Serialization[] candidates, byte[] data) throws I18NException
candidates - The serializations.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.public SignatureCharset[] getSignatureCharsets()
Copyright © 2015. All Rights Reserved.