public int read() throws java.io.IOException {
synchronized (lock) {
    char charArray[]=new char[1];
    if (read(charArray,0,1) != -1) {
      return charArray[0];
    }
    return -1;
  }
}

public int read ( ) throws java . io . IOException { synchronized ( lock ) { char charArray [ ] = new char [ 1 ] ; if ( read ( charArray , 0 , 1 ) != - 1 ) { return charArray [ 0 ] ; } return - 1 ; } }
read a single character . this method will block until a character is available , an i / o error occurs , or the end of the stream is reached . subclasses that intend to support efficient single - character input should override this method .
