public int read()

in apache-rat-core/src/main/java/org/apache/rat/annotation/AbstractLicenseAppender.java [530:544]


    public int read(byte[] buf, int off, int len) throws IOException {
        int firstCount = 0;
        int b = 0;
        while ((len > 0) && (b >= 0)) {
            b = readFirstBytes();
            if (b >= 0) {
                buf[off++] = (byte) (b & 0xFF);
                len--;
                firstCount++;
            }
        }
        int secondCount = in.read(buf, off, len);
        return (secondCount < 0)
                ? (firstCount > 0 ? firstCount : -1) : firstCount + secondCount;
    }