public long skip()

in src/main/java/org/apache/commons/io/input/UnsynchronizedBufferedReader.java [448:476]


    public long skip(final long amount) throws IOException {
        if (amount < 0) {
            throw new IllegalArgumentException();
        }
        checkOpen();
        if (amount < 1) {
            return 0;
        }
        if (end - pos >= amount) {
            pos += Math.toIntExact(amount);
            return amount;
        }

        long read = end - pos;
        pos = end;
        while (read < amount) {
            if (fillBuf() == EOF) {
                return read;
            }
            if (end - pos >= amount - read) {
                pos += Math.toIntExact(amount - read);
                return amount;
            }
            // Couldn't get all the characters, skip what we read
            read += end - pos;
            pos = end;
        }
        return amount;
    }