public enum Signature extends Enum<Signature>
| Enum Constant and Description |
|---|
NONE |
UTF16BE |
UTF16LE |
UTF32BE |
UTF32LE |
UTF8 |
| Modifier and Type | Field and Description |
|---|---|
static Signature[] |
EMPTY_ARRAY |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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
public static final Signature[] EMPTY_ARRAY
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 nameNullPointerException - 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.Copyright © 2015. All Rights Reserved.