public int read(char[] cbuf,int off,int len) throws IOException {
  int i=0;
  for (i=0; i < len; i++) {
    int ch1=is.read();
    int ch2=is.read();
    if (ch1 < 0)     return i == 0 ? -1 : i;
    cbuf[off + i]=(char)((ch2 << 8) + ch1);
  }
  return i;
}

public int read ( char [ ] cbuf , int off , int len ) throws IOException { int i = 0 ; for ( i = 0 ; i < len ; i ++ ) { int ch1 = is . read ( ) ; int ch2 = is . read ( ) ; if ( ch1 < 0 ) return i == 0 ? - 1 : i ; cbuf [ off + i ] = ( char ) ( ( ch2 << 8 ) + ch1 ) ; } return i ; }
reads into a character buffer using the correct encoding .
