|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<Signature>
org.marketcetera.util.unicode.Signature
public enum Signature
A byte stream signature. It appears in the beginning (header) of a byte stream, and identifies the charset necessary to interpret the remaining bytes as text.
| Enum Constant Summary | |
|---|---|
NONE
|
|
UTF16BE
|
|
UTF16LE
|
|
UTF32BE
|
|
UTF32LE
|
|
UTF8
|
|
| Field Summary | |
|---|---|
static Signature[] |
EMPTY_ARRAY
|
| Method Summary | |
|---|---|
int |
getLength()
Returns the receiver's BOM length. |
static int |
getLongestLength()
Returns the maximum length of any signature BOM. |
byte[] |
getMark()
Returns the receiver's BOM. |
static Signature |
getPrefixMatch(Signature[] candidates,
byte[] data)
Checks whether any of the given signatures matches the header of the given byte array. |
boolean |
prefixMatch(byte[] data)
Checks whether the receiver's BOM matches the header of the given byte array. |
static Signature |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static Signature[] |
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 Signature NONE
public static final Signature UTF8
public static final Signature UTF16BE
public static final Signature UTF16LE
public static final Signature UTF32BE
public static final Signature UTF32LE
| Field Detail |
|---|
public static final Signature[] EMPTY_ARRAY
| Method Detail |
|---|
public static Signature[] values()
for (Signature c : Signature.values()) System.out.println(c);
public static Signature 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 static int getLongestLength()
public static Signature getPrefixMatch(Signature[] candidates,
byte[] data)
candidates - The signatures.data - The byte array.
public byte[] getMark()
public int getLength()
public boolean prefixMatch(byte[] data)
data - The byte array.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||