Class BOM
java.lang.Object
de.muehlencord.shared.util.file.BOM
Defines possbile file Byte Order Marks used in files.
- Author:
- Joern Muehlencord (joern@muehlencord.de)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int[]BOCU-1 - version 1protected static final int[]BOCU-2 - version 2protected static final int[]GB-18030protected static final int[]SCSUprotected static final int[]UTF-EBCDICprotected static final int[]UTF-1protected static final int[]UTF-16 - big endianprotected static final int[]UTF-16 - little endianprotected static final int[]UTF32(Big Endian)protected static final int[]UTF32(Little Endian)protected static final int[]UTF7 - version 1protected static final int[]UTF7 - version 2protected static final int[]UTF7 - version 3protected static final int[]UTF7 - version 4protected static final int[]UTF-8 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanreturns true, if the given object is a BOM and represents the same encoding as this objectstatic StringgetEncoding(int[] bomBytes) returns the name of the encoding for the given bom bytesinthashCode()returns the hashcode for this object
-
Field Details
-
BOM_UTF32_BE
protected static final int[] BOM_UTF32_BEUTF32(Big Endian) -
BOM_UTF32_LE
protected static final int[] BOM_UTF32_LEUTF32(Little Endian) -
BOM_UTF1
protected static final int[] BOM_UTF1UTF-1 -
BOM_UTF7_1
protected static final int[] BOM_UTF7_1UTF7 - version 1 -
BOM_UTF7_2
protected static final int[] BOM_UTF7_2UTF7 - version 2 -
BOM_UTF7_3
protected static final int[] BOM_UTF7_3UTF7 - version 3 -
BOM_UTF7_4
protected static final int[] BOM_UTF7_4UTF7 - version 4 -
BOM_UTF_EBCDIC
protected static final int[] BOM_UTF_EBCDICUTF-EBCDIC -
BOM_UTF8
protected static final int[] BOM_UTF8UTF-8 -
BOM_SCSU
protected static final int[] BOM_SCSUSCSU -
BOM_BOCU1_1
protected static final int[] BOM_BOCU1_1BOCU-1 - version 1 -
BOM_BOCU1_2
protected static final int[] BOM_BOCU1_2BOCU-2 - version 2 -
BOM_UTF16_BE
protected static final int[] BOM_UTF16_BEUTF-16 - big endian -
BOM_UTF16_LE
protected static final int[] BOM_UTF16_LEUTF-16 - little endian -
BOM_GB_18030
protected static final int[] BOM_GB_18030GB-18030
-
-
Constructor Details
-
BOM
public BOM(int k1, int k2, int k3, int k4) creates a new instance of a BOM- Parameters:
k1- the key1k2- the key2k3- the key3k4- the key4
-
BOM
public BOM(int k1, int k2, int k3) creates a new instance of a BOM- Parameters:
k1- the key1k2- the key2k3- the key3
-
BOM
public BOM(int k1, int k2) creates a new instance of a BOM- Parameters:
k1- the key1k2- the key2
-
BOM
public BOM(int[] keys) creates a new instance of a BOM by the given key array- Parameters:
keys- the keys to use (minimum 2 key, maximum 4 keys are evaluated)
-
-
Method Details
-
equals
-
hashCode
-
getEncoding
returns the name of the encoding for the given bom bytes- Parameters:
bomBytes- the bytes representing the bom- Returns:
- the name of the encoding for the given bom bytes
- Throws:
UnsupportedEncodingException- if no valid encoding name can be found
-