public enum ByteOrderMark extends java.lang.Enum<ByteOrderMark>
Enum Constant and Description |
---|
Utf16BE
UTF-16 big endian byte order mark.
|
Utf16LE
UTF-16 little endian byte order mark.
|
Utf32BE
Utf-32 big endian byte order mark.
|
Utf32LE
Utf-32 little endian byte order mark.
|
Utf8
UTF-8 byte order mark.
|
Modifier and Type | Method and Description |
---|---|
static ByteOrderMark |
check(java.io.InputStream is)
Check whether the given stream starts with a byte order mark.
|
java.nio.charset.Charset |
getCharset()
Get the charset indicated by this byte order mark.
|
static ByteOrderMark |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ByteOrderMark[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
void |
write(java.io.OutputStream os)
Write the byte order mark to the given stream.
|
public static final ByteOrderMark Utf8
public static final ByteOrderMark Utf16BE
public static final ByteOrderMark Utf16LE
public static final ByteOrderMark Utf32BE
public static final ByteOrderMark Utf32LE
public static ByteOrderMark[] values()
for (ByteOrderMark c : ByteOrderMark.values()) System.out.println(c);
public static ByteOrderMark valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null@NotNull public java.nio.charset.Charset getCharset()
public void write(@NotNull java.io.OutputStream os) throws java.io.IOException
os
- output streamjava.io.IOException
- on write errors@Nullable public static ByteOrderMark check(@NotNull java.io.InputStream is) throws java.io.IOException
is
- input stream, which has to support markingnull
if no BOM was foundjava.io.IOException
- on read errors