コード例 #1
0
 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;
 }
コード例 #2
0
 /** Closes any files opened by this tokenizer. */
 public void close() {
   if (wantClose) {
     try {
       is.close();
     } catch (IOException e) {
     }
   }
 }
コード例 #3
0
 private void ungetChar(int c) throws IOException {
   if (c == -1) return;
   is.unread(c);
   if (c == '\n') line--;
 }