public static int readChars(Reader r,char[] charArray) throws IOException {
  int totalCharsRead=0;
  int charsRead=r.read(charArray);
  while (charsRead >= 0) {
    totalCharsRead+=charsRead;
    if (totalCharsRead == charArray.length) {
      break;
    }
    charsRead=r.read(charArray,totalCharsRead,charArray.length - totalCharsRead);
  }
  return totalCharsRead;
}

public static int readChars ( Reader r , char [ ] charArray ) throws IOException { int totalCharsRead = 0 ; int charsRead = r . read ( charArray ) ; while ( charsRead >= 0 ) { totalCharsRead += charsRead ; if ( totalCharsRead == charArray . length ) { break ; } charsRead = r . read ( charArray , totalCharsRead , charArray . length - totalCharsRead ) ; } return totalCharsRead ; }
fills the supplied character array with characters read from the specified reader . this method will only stop reading when the character array has been filled completely , or the end of the stream has been reached .
