consumeBOM
public static final String consumeBOM(InputStream in,
String default_encoding)
throws IOException
Sets a mark in the InputStream for 3 bytes to check for a BOM. If the BOM
stands for UTF-8 encoded content then the stream will not be reset, otherwise
for UTF-16 with a BOM or any other encoding situation the stream is reset to the
mark (as for UTF-16 the parser will handle the BOM).
- Parameters:
in - InputStream containing BOM and must support mark().default_encoding - The default character set encoding. null or "" => system default
- Returns:
- The file character set encoding.
- Throws:
IOException