Code example for SessionInputBuffer

Methods: read

0
 
        if (pos >= contentLength) {
            return -1; 
        } 
        pos++;
        return this.in.read();
    } 
 
    /** 
     * Does standard {@link InputStream#read(byte[], int, int)} behavior, but 
     * also notifies the watcher when the contents have been consumed. 
     * 
     * @param b     The byte array to fill. 
     * @param off   Start filling at this position. 
     * @param len   The number of bytes to attempt to read. 
     * @return The number of bytes read, or -1 if the end of content has been 
     *  reached. 
     * 
     * @throws java.io.IOException Should an error occur on the wrapped stream. 
     */ 
    public int read (byte[] b, int off, int len) throws java.io.IOException {