protected void parseCharacters(CharsetDetector det) {
            int b;
            boolean ignoreSpace = false;

            while ((b = nextByte(det)) >= 0) {
                byte mb = byteMap[b];

                // TODO: 0x20 might not be a space in all character sets...
                if (mb != 0) {
                    if (!(mb == spaceChar && ignoreSpace)) {
                        addByte(mb);
                    }

                    ignoreSpace = (mb == spaceChar);
                }
            }

        }
This class recognizes single-byte encodings. Because the encoding scheme is so
simple, language statistics are used to do the matching.
<p/>
The Recognizer works by first mapping from bytes in the encoding under test
into that Recognizer's ngram space. Normally this means performing a
lowercase, and excluding codepoints that don't correspond to numbers of
letters. (Accented letters may or may not be ignored or normalised, depending
on the needs of the ngrams)
Then, ngram analysis is run against the transformed text, and a confidence
is calculated.
<p/>
For many of our Recognizers, we have one ngram set per language in each
encoding, and do a simultanious language+charset detection.
<p/>
When adding new Recognizers, the easiest way is to byte map to an existing
encoding for which we have ngrams, excluding non text, and re-use the ngrams.

@internal
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-text-module/src/main/java/org/apache/tika/parser/txt/CharsetRecog_sbcs.java