private int count(int from, int to) {
        assert 0 <= from && to <= counts.length;
        int count = 0;
        for (int i = from; i < to; i++) {
            count += counts[i];
        }
        return count;
    }
Counts eight bit characters, i.e. bytes with their highest bit set.

@return count of eight bit characters
tika-core/src/main/java/org/apache/tika/detect/TextStatistics.java