private int getChar() throws IOException { int c = is.read(); if (c == '\r') { int next = is.read(); if (next != '\n') is.unread(next); c = '\n'; } if (c == '\n') line++; return c; }
private void ungetChar(int c) throws IOException { if (c == -1) return; is.unread(c); if (c == '\n') line--; }