Skip characters until the next character is the requested character. If the requested character is not found, no characters are skipped. @param to A character to skip to. @return The requested character, or zero if the requested character is not found.
(char to)
| 397 | * is not found. |
| 398 | */ |
| 399 | public char skipTo(char to) { |
| 400 | char c; |
| 401 | try { |
| 402 | long startIndex = this.index; |
| 403 | long startCharacter = this.character; |
| 404 | long startLine = this.line; |
| 405 | this.reader.mark(1000000); |
| 406 | do { |
| 407 | c = this.next(); |
| 408 | if (c == 0) { |
| 409 | this.reader.reset(); |
| 410 | this.index = startIndex; |
| 411 | this.character = startCharacter; |
| 412 | this.line = startLine; |
| 413 | return c; |
| 414 | } |
| 415 | } while (c != to); |
| 416 | } catch (IOException exc) { |
| 417 | throw new RuntimeException(exc); |
| 418 | } |
| 419 | |
| 420 | this.back(); |
| 421 | return c; |
| 422 | } |
| 423 | |
| 424 | |
| 425 | /** |