Code example for PushbackReader

0
  private int lineNumber;
  private int charIndex;
 
  public RLexerReader(Reader reader) {
    super(); 
    this.reader = new PushbackReader(reader);
  } 
 
  public int read() throws IOException { 
    int c;
 
    if (npush != 0) {
      c = pushback[--npush];
    } else { 
      try { 
        c = reader.read();
      } catch (IOException e) {
        throw new RLexException("IOException while reading", e);
      } 
    }