Top Description Fields Constructors Methods
com.dd.plist

pack-priv Class ByteOrderMarkReader

extends Object
Class Inheritance

Reads Byte Order Marks for various Unicode encodings.
Author
Daniel Dreibrodt

Field Summary

Modifier and TypeField and Description
private static final int[][]
private String
private final boolean[]
private static final String[]
private int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

The name of the detected charset, or null if no BOM was detected.
detect
(byte[]
The input data.
bytes
)

Detects the encoding of input data that is available as a complete byte array.

public String

Returns:

The name of the detected charset, or null if no charset was detected.
getDetectedCharset
()

Gets the charset that was detected.

public boolean

Returns:

true if the input so far could potentially be a BOM; otherwise, false.
readByte
(int
The byte to process.
b
)

Processes a byte that was read from the input.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BOMsback to summary
private static final int[][] BOMs
charsetback to summary
private String charset
charsetPossibleback to summary
private final boolean[] charsetPossible
Charsetsback to summary
private static final String[] Charsets
offsetback to summary
private int offset

Constructor Detail

ByteOrderMarkReaderback to summary
pack-priv ByteOrderMarkReader()

Method Detail

detectback to summary
public static String detect(byte[] bytes)

Detects the encoding of input data that is available as a complete byte array.

Parameters
bytes:byte[]

The input data.

Returns:String

The name of the detected charset, or null if no BOM was detected.

getDetectedCharsetback to summary
public String getDetectedCharset()

Gets the charset that was detected.

Returns:String

The name of the detected charset, or null if no charset was detected.

readByteback to summary
public boolean readByte(int b)

Processes a byte that was read from the input.

Parameters
b:int

The byte to process.

Returns:boolean

true if the input so far could potentially be a BOM; otherwise, false.