MCPcopy Create free account
hub / github.com/Card-Forge/forge / readBlock

Method readBlock

forge-gui-mobile/src/forge/animation/GifDecoder.java:431–452  ·  view source on GitHub ↗

Reads next variable length block from input. @return number of bytes stored in "buffer"

()

Source from the content-addressed store, hash-verified

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

Callers 4

decodeBitmapDataMethod · 0.95
readContentsMethod · 0.95
readNetscapeExtMethod · 0.95
skipMethod · 0.95

Calls 1

readMethod · 0.95

Tested by

no test coverage detected