|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<SignatureCharset>
org.marketcetera.util.unicode.SignatureCharset
public enum SignatureCharset
A byte stream signature (Signature) coupled with a charset
(UnicodeCharset) that may follow the signature (aka a
signature/charset pair). Observe that, in the absence of a
signature (Signature.NONE), many different charsets are
allowed. Instances of this class enforce signature removal upon
decoding and insertion upon charset; there is no attempt made to
identify matching signatures, as done by Serialization.
| Enum Constant Summary | |
|---|---|
NONE_UTF16BE
|
|
NONE_UTF16LE
|
|
NONE_UTF32BE
|
|
NONE_UTF32LE
|
|
NONE_UTF8
|
|
UTF16BE_UTF16BE
|
|
UTF16LE_UTF16LE
|
|
UTF32BE_UTF32BE
|
|
UTF32LE_UTF32LE
|
|
UTF8_UTF8
|
|
| Method Summary | |
|---|---|
void |
assertSupported()
Asserts that the JVM supports the receiver's charset. |
String |
decode(byte[] data)
Decodes the given byte array using the receiver's charset, and returns the result. |
byte[] |
encode(String data)
Encodes the given string using the receiver's charset, and returns the result. |
UnicodeCharset |
getCharset()
Returns the receiver's charset. |
Signature |
getSignature()
Returns the receiver's signature. |
boolean |
isSupported()
Checks whether the JVM supports the receiver's charset. |
static SignatureCharset |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static SignatureCharset[] |
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 SignatureCharset NONE_UTF8
public static final SignatureCharset NONE_UTF16BE
public static final SignatureCharset NONE_UTF16LE
public static final SignatureCharset NONE_UTF32BE
public static final SignatureCharset NONE_UTF32LE
public static final SignatureCharset UTF8_UTF8
public static final SignatureCharset UTF16BE_UTF16BE
public static final SignatureCharset UTF16LE_UTF16LE
public static final SignatureCharset UTF32BE_UTF32BE
public static final SignatureCharset UTF32LE_UTF32LE
| Method Detail |
|---|
public static SignatureCharset[] values()
for (SignatureCharset c : SignatureCharset.values()) System.out.println(c);
public static SignatureCharset 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 Signature getSignature()
public UnicodeCharset getCharset()
public boolean isSupported()
public void assertSupported()
throws I18NException
I18NException - Thrown if it does not.
public String decode(byte[] data)
throws I18NException
data - The byte array, which may be null.
I18NException - Thrown if the receiver's charset is not a
supported JVM charset.
public byte[] encode(String data)
throws I18NException
data - The string, which may be null.
I18NException - Thrown if the receiver's charset is not a
supported JVM charset.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||