Reads next variable length block from input. @return number of bytes stored in "buffer"
()
| 429 | * @return number of bytes stored in "buffer" |
| 430 | */ |
| 431 | protected int readBlock() { |
| 432 | blockSize = read(); |
| 433 | int n = 0; |
| 434 | if (blockSize > 0) { |
| 435 | try { |
| 436 | int count = 0; |
| 437 | while (n < blockSize) { |
| 438 | count = in.read(block, n, blockSize - n); |
| 439 | if (count == -1) { |
| 440 | break; |
| 441 | } |
| 442 | n += count; |
| 443 | } |
| 444 | } catch (Exception e) { |
| 445 | e.printStackTrace(); |
| 446 | } |
| 447 | if (n < blockSize) { |
| 448 | status = STATUS_FORMAT_ERROR; |
| 449 | } |
| 450 | } |
| 451 | return n; |
| 452 | } |
| 453 | |
| 454 | /** |
| 455 | * Reads color table as 256 RGB integer values |
no test coverage detected