/src/main/java/org/htmlunit/util/EncodingSniffer.java
final byte[] bytes = read( content, -4) ;
final byte[] bytes = read ( content, 3 ) ;
public static Charset sniffUnknownContentTypeEncoding(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); return encoding; } public static Charset sniffEncodingFromHttpHeaders(final List<NameValuePair> headers) { for (final NameValuePair pair : headers) { final String name = pair.getName();