(byte[] asciiCodeValue)
| 317 | } |
| 318 | |
| 319 | @SuppressWarnings("fallthrough") |
| 320 | private static Status fromCodeValueSlow(byte[] asciiCodeValue) { |
| 321 | int index = 0; |
| 322 | int codeValue = 0; |
| 323 | switch (asciiCodeValue.length) { |
| 324 | case 2: |
| 325 | if (asciiCodeValue[index] < '0' || asciiCodeValue[index] > '9') { |
| 326 | break; |
| 327 | } |
| 328 | codeValue += (asciiCodeValue[index++] - '0') * 10; |
| 329 | // fall through |
| 330 | case 1: |
| 331 | if (asciiCodeValue[index] < '0' || asciiCodeValue[index] > '9') { |
| 332 | break; |
| 333 | } |
| 334 | codeValue += asciiCodeValue[index] - '0'; |
| 335 | if (codeValue < STATUS_LIST.size()) { |
| 336 | return STATUS_LIST.get(codeValue); |
| 337 | } |
| 338 | break; |
| 339 | default: |
| 340 | break; |
| 341 | } |
| 342 | return UNKNOWN.withDescription("Unknown code " + new String(asciiCodeValue, US_ASCII)); |
| 343 | } |
| 344 | |
| 345 | /** |
| 346 | * Return a {@link Status} given a canonical error {@link Code} object. |
no test coverage detected