markwon-html/src/main/java/ru/noties/markwon/html/jsoup/parser/CharacterReader.java
private void bufferUp() {
        if (bufPos < bufSplitPoint)
            return;

        try {
            reader.skip(bufPos);
            reader.mark(maxBufferLen);
            final int read = reader.read(charBuf);
            reader.reset();
            if (read != -1) {
                bufLength = read;
                readerPos += bufPos;
                bufPos = 0;
                bufMark = 0;
                bufSplitPoint = bufLength > readAheadLimit ? readAheadLimit : bufLength;
            }
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }
private void bufferUp() {
        if (bufPos < bufSplitPoint)
            return;

        try {
            reader.skip(bufPos);
            reader.mark(maxBufferLen);
            final int read = reader.read(charBuf);
            reader.reset();
            if (read != -1) {
                bufLength = read;
                readerPos += bufPos;
                bufPos = 0;
                bufMark = 0;
                bufSplitPoint = bufLength > readAheadLimit ? readAheadLimit : bufLength;
            }
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }
}