Package com.dd.plist
Class ByteOrderMarkReader
- java.lang.Object
-
- com.dd.plist.ByteOrderMarkReader
-
class ByteOrderMarkReader extends java.lang.ObjectReads Byte Order Marks for various Unicode encodings.
-
-
Field Summary
Fields Modifier and Type Field Description private static int[][]BOMsprivate java.lang.Stringcharsetprivate boolean[]charsetPossibleprivate static java.lang.String[]Charsetsprivate intoffset
-
Constructor Summary
Constructors Constructor Description ByteOrderMarkReader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringdetect(byte[] bytes)Detects the encoding of input data that is available as a complete byte array.java.lang.StringgetDetectedCharset()Gets the charset that was detected.booleanreadByte(int b)Processes a byte that was read from the input.
-
-
-
Method Detail
-
getDetectedCharset
public java.lang.String getDetectedCharset()
Gets the charset that was detected.- Returns:
- The name of the detected charset, or
null if no charset was detected.
-
readByte
public boolean readByte(int b)
Processes a byte that was read from the input.- Parameters:
b- The byte to process.- Returns:
true if the input so far could potentially be a BOM; otherwise,false .
-
detect
public static java.lang.String detect(byte[] bytes)
Detects the encoding of input data that is available as a complete byte array.- Parameters:
bytes- The input data.- Returns:
- The name of the detected charset, or
null if no BOM was detected.
-
-