Package org.apache.wicket.util.io
Class ByteOrderMark
- java.lang.Object
-
- org.apache.wicket.util.io.ByteOrderMark
-
- All Implemented Interfaces:
Serializable
public class ByteOrderMark extends Object implements Serializable
Byte Order Mark (BOM) representation - seeBOMInputStream.- Since:
- 2.0
- Version:
- $Id$
- See Also:
BOMInputStream, Wikipedia: Byte Order Mark, W3C: Autodetection of Character Encodings (Non-Normative), Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ByteOrderMarkUTF_16BEUTF-16BE BOM (Big-Endian)static ByteOrderMarkUTF_16LEUTF-16LE BOM (Little-Endian)static ByteOrderMarkUTF_32BEUTF-32BE BOM (Big-Endian)static ByteOrderMarkUTF_32LEUTF-32LE BOM (Little-Endian)static ByteOrderMarkUTF_8UTF-8 BOMstatic charUTF_BOMUnicode BOM character; external form depends on the encoding.
-
Constructor Summary
Constructors Constructor Description ByteOrderMark(String charsetName, int... bytes)Construct a new BOM.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Indicates if this BOM's bytes equals another.intget(int pos)The byte at the specified position.byte[]getBytes()Return a copy of the BOM's bytes.StringgetCharsetName()Return the name of theCharsetthe BOM represents.inthashCode()Return the hashcode for this BOM.intlength()Return the length of the BOM's bytes.StringtoString()Provide a String representation of the BOM.
-
-
-
Field Detail
-
UTF_8
public static final ByteOrderMark UTF_8
UTF-8 BOM
-
UTF_16BE
public static final ByteOrderMark UTF_16BE
UTF-16BE BOM (Big-Endian)
-
UTF_16LE
public static final ByteOrderMark UTF_16LE
UTF-16LE BOM (Little-Endian)
-
UTF_32BE
public static final ByteOrderMark UTF_32BE
UTF-32BE BOM (Big-Endian)- Since:
- 2.2
-
UTF_32LE
public static final ByteOrderMark UTF_32LE
UTF-32LE BOM (Little-Endian)- Since:
- 2.2
-
UTF_BOM
public static final char UTF_BOM
Unicode BOM character; external form depends on the encoding.- Since:
- 2.5
- See Also:
- Byte Order Mark (BOM) FAQ, Constant Field Values
-
-
Constructor Detail
-
ByteOrderMark
public ByteOrderMark(String charsetName, int... bytes)
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 Detail
-
getCharsetName
public String getCharsetName()
Return the name of theCharsetthe BOM represents.- Returns:
- the character set name
-
length
public int length()
Return the length of the BOM's bytes.- Returns:
- the length of the BOM's bytes
-
get
public int get(int pos)
The byte at the specified position.- Parameters:
pos- The position- Returns:
- The specified byte
-
getBytes
public byte[] getBytes()
Return a copy of the BOM's bytes.- Returns:
- a copy of the BOM's bytes
-
hashCode
public int hashCode()
Return the hashcode for this BOM.- Overrides:
hashCodein classObject- Returns:
- the hashcode for this BOM.
- See Also:
Object.hashCode()
-
-