code: public int read(char []cbuf, int off, int len)
      throws IOException
    {
      for (int i = 0; i < len; i++) {
        int ch = read();
  
        if (ch < 0)
          return len;
  
        cbuf[off + i] = (char) ch;
      }
  
      return len;
    }
docs: Reads into a character buffer using the correct encoding.
  
  @param cbuf character buffer receiving the data.
  @param off starting offset into the buffer.
  @param len number of characters to read.
  
  @return the number of characters read or -1 on end of file.