/src/main/java/org/htmlunit/util/EncodingSniffer.java
byte[] bytes = read ( content, 3 ) ;
public static Charset sniffXmlEncoding(final List<NameValuePair> headers, final InputStream content) throws IOException { Charset encoding = sniffEncodingFromHttpHeaders(headers); if (encoding != null || content == null) { return encoding; } <extra_id_0> encoding = sniffEncodingFromUnicodeBom(bytes); if (encoding != null) { return encoding; } bytes = readAndPrepend(content, SIZE_OF_XML_CONTENT_SNIFFED, bytes); encoding = sniffEncodingFromXmlDeclaration(bytes);