code: public int read() throws IOException {
          synchronized (lock) {
              ensureOpen();
              if (pos < buf.length)
                  return buf[pos++];
              else
                  return super.read();
          }
      }
docs: Reads a single character.
  
  @return     The character read, or -1 if the end of the stream has been
  reached
  
  @exception  IOException  If an I/O error occurs