Package com.adobe.epubcheck.xml
Class XMLEncodingSniffer
- java.lang.Object
-
- com.adobe.epubcheck.xml.XMLEncodingSniffer
-
public final class XMLEncodingSniffer extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]EBCDIC_MAGICprivate static byte[][]UCS4_MAGICprivate static byte[][]UTF16_MAGICprivate static byte[]UTF8_MAGIC
-
Constructor Summary
Constructors Modifier Constructor Description privateXMLEncodingSniffer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanhasUTF8BOM(java.io.InputStream in)Checks if the parameter input stream has a UTF-8 byte order mark.private static booleanmatchesMagic(byte[] magic, byte[] buffer)static java.lang.StringsniffEncoding(java.io.InputStream in)
-
-
-
Method Detail
-
matchesMagic
private static boolean matchesMagic(byte[] magic, byte[] buffer)
-
sniffEncoding
public static java.lang.String sniffEncoding(java.io.InputStream in) throws java.io.IOException- Throws:
java.io.IOException
-
hasUTF8BOM
public static boolean hasUTF8BOM(java.io.InputStream in) throws java.io.IOExceptionChecks if the parameter input stream has a UTF-8 byte order mark.- Parameters:
in- an input stream- Returns:
trueif and only if the input stream starts with a UTF-8 BOM- Throws:
java.io.IOException
-
-