Extract an integer, starting at the current position. Updates the internal index to beyond the number. Returns -1 if a number was not found. @return a number
()
| 334 | * @return a number |
| 335 | */ |
| 336 | public int readNumber() { |
| 337 | // Skip leading spaces |
| 338 | skipSpaces(); |
| 339 | |
| 340 | int start = index; |
| 341 | while (index < size && Character.isDigit((char)buffer[index])) |
| 342 | index++; |
| 343 | |
| 344 | if (index > start) { |
| 345 | try { |
| 346 | return ASCIIUtility.parseInt(buffer, start, index); |
| 347 | } catch (NumberFormatException nex) { } |
| 348 | } |
| 349 | |
| 350 | return -1; |
| 351 | } |
| 352 | |
| 353 | /** |
| 354 | * Extract a long number, starting at the current position. Updates the |
no test coverage detected