@Override public int read() throws IOException {
synchronized (lock) {
    if (isOpen()) {
      if (pos != count) {
        return str.charAt(pos++);
      }
      return -1;
    }
    throw new IOException("StringReader is closed");
  }
}

@ Override public int read ( ) throws IOException { synchronized ( lock ) { if ( isOpen ( ) ) { if ( pos != count ) { return str . charAt ( pos ++ ) ; } return - 1 ; } throw new IOException ( "StringReader is closed" ) ; } }
reads a single character from this stringreader and returns the result as an int . the 2 higher - order bytes are set to 0 . if the end of reader was encountered then return - 1 .
