code: @Override
  	public int read(char[] cbuf, int off, int len) throws IOException {
  		int bytesread = 0;
  		while (len-- > 0) {
  			int ch = read();
  			if (ch == -1) {
  				return (bytesread > 0) ? bytesread : -1;
  			}
  			cbuf[off++] = (char) ch;
  			bytesread++;
  		}
  		return bytesread;
  	}
docs: Reads characters into a portion of an array.
  
  @param cbuf
  - Destination buffer
  @param off
  - Offset at which to start writing characters
  @param len
  - Maximum number of characters to read
  @return The character read, or -1 if the end of the stream has been
  reached
  @throws IOException
  if an I/O error occurs