java.lang.Object
org.apache.wicket.util.io.ByteOrderMark
- All Implemented Interfaces:
Serializable
Byte Order Mark (BOM) representation - see
BOMInputStream
.- Since:
- 2.0
- Version:
- $Id$
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ByteOrderMark
UTF-16BE BOM (Big-Endian)static final ByteOrderMark
UTF-16LE BOM (Little-Endian)static final ByteOrderMark
UTF-32BE BOM (Big-Endian)static final ByteOrderMark
UTF-32LE BOM (Little-Endian)static final ByteOrderMark
UTF-8 BOMstatic final char
Unicode BOM character; external form depends on the encoding. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates if this BOM's bytes equals another.int
get
(int pos) The byte at the specified position.byte[]
getBytes()
Return a copy of the BOM's bytes.Return the name of theCharset
the BOM represents.int
hashCode()
Return the hashcode for this BOM.int
length()
Return the length of the BOM's bytes.toString()
Provide a String representation of the BOM.
-
Field Details
-
UTF_8
UTF-8 BOM -
UTF_16BE
UTF-16BE BOM (Big-Endian) -
UTF_16LE
UTF-16LE BOM (Little-Endian) -
UTF_32BE
UTF-32BE BOM (Big-Endian)- Since:
- 2.2
-
UTF_32LE
UTF-32LE BOM (Little-Endian)- Since:
- 2.2
-
UTF_BOM
Unicode BOM character; external form depends on the encoding.- Since:
- 2.5
- See Also:
-
-
Constructor Details
-
ByteOrderMark
Construct a new BOM.- Parameters:
charsetName
- The name of the charset the BOM representsbytes
- The BOM's bytes- Throws:
IllegalArgumentException
- if the charsetName is null or zero lengthIllegalArgumentException
- if the bytes are null or zero length
-
-
Method Details
-
getCharsetName
Return the name of theCharset
the BOM represents.- Returns:
- the character set name
-
length
Return the length of the BOM's bytes.- Returns:
- the length of the BOM's bytes
-
get
The byte at the specified position.- Parameters:
pos
- The position- Returns:
- The specified byte
-
getBytes
Return a copy of the BOM's bytes.- Returns:
- a copy of the BOM's bytes
-
equals
Indicates if this BOM's bytes equals another. -
hashCode
Return the hashcode for this BOM. -
toString
Provide a String representation of the BOM.
-