Scott Wilson
-
2017-02-06
- Group: --> v2.20
src/main/java/org/htmlcleaner/Utils.java
public static String getCharsetFromContent
....
byte chunk[] = new byte[2048];
int bytesRead = stream.read(chunk);
if (bytesRead > 0) {
String startContent = new String(chunk);
Since it is posible, that there would be read less than 2048 bytes, i believe the last quoted line should be changed to
String startContent = new String(chunk, 0, bytesRead);