detector = new CharsetDetector();
detector.enableInputFilter(true);
detector.setText(bis);
if (declaredEncoding!=null && !"".equals(declaredEncoding))
detector.setDeclaredEncoding(declaredEncoding);
CharsetMatch[] matches = detector.detectAll();
bis.close();
encoding = HttpUtils.filtreEncoding(matches[0].getName().toLowerCase());
if (encoding!=null && !"".equals(encoding)) {
if (encodingFreq.containsKey(encoding))
encodingFreq.put(encoding, encodingFreq.get(encoding) + 2);