public class ByteOrderMark
extends java.lang.Object
implements java.io.Serializable
BOMInputStream.
We define the follow BOM constants:
Serialization is deprecated and will be removed in 3.0.
| Modifier and Type | Field and Description |
|---|---|
static ByteOrderMark |
UTF_16BE
UTF-16BE BOM (Big-Endian).
|
static ByteOrderMark |
UTF_16LE
UTF-16LE BOM (Little-Endian).
|
static ByteOrderMark |
UTF_32BE
UTF-32BE BOM (Big-Endian).
|
static ByteOrderMark |
UTF_32LE
UTF-32LE BOM (Little-Endian).
|
static ByteOrderMark |
UTF_8
UTF-8 BOM.
|
static char |
UTF_BOM
Unicode BOM character; external form depends on the encoding.
|
| Constructor and Description |
|---|
ByteOrderMark(java.lang.String charsetName,
int... bytes)
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Indicates if this instance's bytes equals another.
|
int |
get(int pos)
Gets the byte at the specified position.
|
byte[] |
getBytes()
Gets a copy of the BOM's bytes.
|
java.lang.String |
getCharsetName()
Gets the name of the
Charset the BOM represents. |
int |
hashCode()
Computes the hash code for this BOM.
|
int |
length()
Gets the length of the BOM's bytes.
|
java.lang.String |
toString()
Converts this instance to a String representation of the BOM.
|
public static final ByteOrderMark UTF_8
This BOM is:
0xEF 0xBB 0xBF
public static final ByteOrderMark UTF_16BE
This BOM is:
0xFE 0xFF
public static final ByteOrderMark UTF_16LE
This BOM is:
0xFF 0xFE
public static final ByteOrderMark UTF_32BE
This BOM is:
0x00 0x00 0xFE 0xFF
public static final ByteOrderMark UTF_32LE
This BOM is:
0xFF 0xFE 0x00 0x00
public static final char UTF_BOM
public ByteOrderMark(java.lang.String charsetName,
int... bytes)
charsetName - The name of the charset the BOM representsbytes - The BOM's bytesjava.lang.IllegalArgumentException - if the charsetName is zero lengthjava.lang.IllegalArgumentException - if the bytes are zero lengthpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - The object to compare topublic int get(int pos)
pos - The positionpublic byte[] getBytes()
public java.lang.String getCharsetName()
Charset the BOM represents.public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public int length()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2010 - 2023 Adobe. All Rights Reserved