CharsetMatch match(CharsetDetector det) { byte[] input = det.fRawInput; int confidence = 10; int bytesToCheck = Math.min(input.length, 30); for (int charIndex = 0; charIndex < bytesToCheck - 1; charIndex += 2) { int codeUnit = codeUnit16FromBytes(input[charIndex + 1], input[charIndex]); if (charIndex == 0 && codeUnit == 0xFEFF) { confidence = 100; break; } confidence = adjustConfidence(codeUnit, confidence); if (confidence == 0 || confidence == 100) { break; } } if (bytesToCheck < 4 && confidence < 100) { confidence = 0; } if (confidence > 0) { return new CharsetMatch(det, this, confidence); } return null; } }
CharsetMatch match(CharsetDetector det) { byte[] input = det.fRawInput; int confidence = 10; int bytesToCheck = Math.min(input.length, 30); for (int charIndex = 0; charIndex < bytesToCheck - 1; charIndex += 2) { int codeUnit = codeUnit16FromBytes(input[charIndex + 1], input[charIndex]); if (charIndex == 0 && codeUnit == 0xFEFF) { confidence = 100; break; } confidence = adjustConfidence(codeUnit, confidence); if (confidence == 0 || confidence == 100) { break; } } if (bytesToCheck < 4 && confidence < 100) { confidence = 0; } if (confidence > 0) { return new CharsetMatch(det, this, confidence); } return null; } }
CharsetMatch match(CharsetDetector det) { byte[] input = det.fRawInput; int confidence = 10; int bytesToCheck = Math.min(input.length, 30); for (int charIndex = 0; charIndex < bytesToCheck - 1; charIndex += 2) { int codeUnit = codeUnit16FromBytes(input[charIndex + 1], input[charIndex]); if (charIndex == 0 && codeUnit == 0xFEFF) { confidence = 100; break; } confidence = adjustConfidence(codeUnit, confidence); if (confidence == 0 || confidence == 100) { break; } } if (bytesToCheck < 4 && confidence < 100) { confidence = 0; } if (confidence > 0) { return new CharsetMatch(det, this, confidence); } return null; } }
CharsetMatch match(CharsetDetector det) { byte[] input = det.fRawInput; int confidence = 10; int bytesToCheck = Math.min(input.length, 30); for (int charIndex = 0; charIndex < bytesToCheck - 1; charIndex += 2) { int codeUnit = codeUnit16FromBytes(input[charIndex + 1], input[charIndex]); if (charIndex == 0 && codeUnit == 0xFEFF) { confidence = 100; break; } confidence = adjustConfidence(codeUnit, confidence); if (confidence == 0 || confidence == 100) { break; } } if (bytesToCheck < 4 && confidence < 100) { confidence = 0; } if (confidence > 0) { return new CharsetMatch(det, this, confidence); } return null; } }