Consume ASCII digits, appending them to the supplied builder in bulk. Stops before the first non-digit character, which is left unconsumed. @param sink StringBuilder that accumulates the digits @return the unconsumed non-digit character as an unsigned UTF-16 code unit; #EOF if i
(StringBuilder sink)
| 207 | * input is exhausted |
| 208 | */ |
| 209 | public int appendDigits(StringBuilder sink) { |
| 210 | while (fill()) { |
| 211 | int start = position + 1; |
| 212 | for (int i = start; i < filled; i++) { |
| 213 | char c = buffer[i]; |
| 214 | if (c < '0' || c > '9') { |
| 215 | sink.append(buffer, start, i - start); |
| 216 | position = i - 1; |
| 217 | return c; |
| 218 | } |
| 219 | } |
| 220 | sink.append(buffer, start, filled - start); |
| 221 | position = filled - 1; |
| 222 | } |
| 223 | |
| 224 | return EOF; |
| 225 | } |
| 226 | |
| 227 | /** |
| 228 | * Return a string containing the most recently consumed input characters. |
no test coverage detected