public int read(char cbuf[],int off,int len) throws IOException {
synchronized (lock) {
    ensureOpen();
    if ((off < 0) || (off > cbuf.length) || (len < 0)|| ((off + len) > cbuf.length)|| ((off + len) < 0)) {
      throw new IndexOutOfBoundsException();
    }
 else     if (len == 0) {
      return 0;
    }
    if (next >= length)     return -1;
    int n=Math.min(length - next,len);
    str.getChars(next,next + n,cbuf,off);
    next+=n;
    return n;
  }
}

public int read ( char cbuf [ ] , int off , int len ) throws IOException { synchronized ( lock ) { ensureOpen ( ) ; if ( ( off < 0 ) || ( off > cbuf . length ) || ( len < 0 ) || ( ( off + len ) > cbuf . length ) || ( ( off + len ) < 0 ) ) { throw new IndexOutOfBoundsException ( ) ; } else if ( len == 0 ) { return 0 ; } if ( next >= length ) return - 1 ; int n = Math . min ( length - next , len ) ; str . getChars ( next , next + n , cbuf , off ) ; next += n ; return n ; } }
reads characters into a portion of an array .
