public enum EUnicodeBOM extends Enum<EUnicodeBOM> implements IHasByteSize
| Enum Constant and Description |
|---|
BOM_BOCU_1
BOCU
|
BOM_BOCU_1_ALT2
BOCU
|
BOM_GB_18030
GB 18030
|
BOM_SCSU
SCSU - Single-byte mode Quote Unicode
|
BOM_SCSU_TO_UCS
SCSU - Single-byte mode Change to Unicode
|
BOM_SCSU_W0_TO_FE80
SCSU - Single-byte mode Define dynamic window 0 to 0xFE80
|
BOM_SCSU_W1_TO_FE80
SCSU - Single-byte mode Define dynamic window 1 to 0xFE80
|
BOM_SCSU_W2_TO_FE80
SCSU - Single-byte mode Define dynamic window 2 to 0xFE80
|
BOM_SCSU_W3_TO_FE80
SCSU - Single-byte mode Define dynamic window 3 to 0xFE80
|
BOM_SCSU_W4_TO_FE80
SCSU - Single-byte mode Define dynamic window 4 to 0xFE80
|
BOM_SCSU_W5_TO_FE80
SCSU - Single-byte mode Define dynamic window 5 to 0xFE80
|
BOM_SCSU_W6_TO_FE80
SCSU - Single-byte mode Define dynamic window 6 to 0xFE80
|
BOM_SCSU_W7_TO_FE80
SCSU - Single-byte mode Define dynamic window 7 to 0xFE80
|
BOM_UTF_1
UTF-1
|
BOM_UTF_16_BIG_ENDIAN
UTF-16 Big Endian
|
BOM_UTF_16_LITTLE_ENDIAN
UTF-16 Little Endian
|
BOM_UTF_32_BIG_ENDIAN
UTF-32 Big Endian
|
BOM_UTF_32_LITTLE_ENDIAN
UTF-32 Little Endian
|
BOM_UTF_7
UTF-7
|
BOM_UTF_7_ALT2
UTF-7
|
BOM_UTF_7_ALT3
UTF-7
|
BOM_UTF_7_ALT4
UTF-7
|
BOM_UTF_8
UTF-8
|
BOM_UTF_EBCDIC
UTF-EBCDIC
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getAllBytes() |
int |
getByteCount() |
Charset |
getCharset() |
String |
getCharsetName() |
static EUnicodeBOM |
getFromBytesOrNull(byte[] aBytes)
Find the BOM that is matching the passed byte array.
|
static int |
getMaximumByteCount() |
long |
getSizeInBytes() |
boolean |
isPresent(byte[] aBytes)
Check if the passed byte array starts with this BOM's bytes.
|
static EUnicodeBOM |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static EUnicodeBOM[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final EUnicodeBOM BOM_UTF_32_BIG_ENDIAN
public static final EUnicodeBOM BOM_UTF_32_LITTLE_ENDIAN
public static final EUnicodeBOM BOM_UTF_7
public static final EUnicodeBOM BOM_UTF_7_ALT2
public static final EUnicodeBOM BOM_UTF_7_ALT3
public static final EUnicodeBOM BOM_UTF_7_ALT4
public static final EUnicodeBOM BOM_UTF_EBCDIC
public static final EUnicodeBOM BOM_BOCU_1_ALT2
public static final EUnicodeBOM BOM_GB_18030
public static final EUnicodeBOM BOM_UTF_8
public static final EUnicodeBOM BOM_UTF_1
public static final EUnicodeBOM BOM_BOCU_1
public static final EUnicodeBOM BOM_SCSU
public static final EUnicodeBOM BOM_SCSU_TO_UCS
public static final EUnicodeBOM BOM_SCSU_W0_TO_FE80
public static final EUnicodeBOM BOM_SCSU_W1_TO_FE80
public static final EUnicodeBOM BOM_SCSU_W2_TO_FE80
public static final EUnicodeBOM BOM_SCSU_W3_TO_FE80
public static final EUnicodeBOM BOM_SCSU_W4_TO_FE80
public static final EUnicodeBOM BOM_SCSU_W5_TO_FE80
public static final EUnicodeBOM BOM_SCSU_W6_TO_FE80
public static final EUnicodeBOM BOM_SCSU_W7_TO_FE80
public static final EUnicodeBOM BOM_UTF_16_BIG_ENDIAN
public static final EUnicodeBOM BOM_UTF_16_LITTLE_ENDIAN
public static EUnicodeBOM[] values()
for (EUnicodeBOM c : EUnicodeBOM.values()) System.out.println(c);
public static EUnicodeBOM 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 null@Nonnull @Nonempty @ReturnsMutableCopy public byte[] getAllBytes()
@Nonnegative public int getByteCount()
@Nonnegative public long getSizeInBytes()
getSizeInBytes in interface IHasByteSizepublic boolean isPresent(@Nullable byte[] aBytes)
aBytes - The byte array to search for a BOM. May be null or
empty.true if the passed byte array starts with this BOM,
false otherwise.@Nullable public String getCharsetName()
null if no known
charset exists for Java. This string may be present, even if
getCharset() returns null. To support e.g.
"utf-7" you need to add additional JAR files.@Nullable public Charset getCharset()
null if the
charset is not part of the Sun JDK.@Nonnegative public static int getMaximumByteCount()
@Nullable public static EUnicodeBOM getFromBytesOrNull(@Nullable byte[] aBytes)
aBytes - The bytes to be checked for the BOM. May be null. To
check all BOMs, this array must have at least 4 (=
getMaximumByteCount()) bytes.null if the passed bytes do not resemble a BOM.Copyright © 2014–2015 Philip Helger. All rights reserved.