MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / readBlock

Method readBlock

src/javajs/util/VideoReader.java:85–109  ·  view source on GitHub ↗
(List<Map<String, Object>> contents)

Source from the content-addressed store, hash-verified

83 }
84
85 protected void readBlock(List<Map<String, Object>> contents) throws IOException {
86 int pt = this.pt;
87 blockLen = readInt();
88 blockType = readString(4);
89 if (blockLen == 1) {
90 // special flag for long length not int
91 // presuming here it is not THAT large
92 blockLen = (int) is.readLong();
93 }
94 if (verbose)
95 System.out.println(blockType + "\t" + pt + "\t0x" + Long.toHexString(pt) + "\t" + blockLen);
96 Map<String, Object> map = new Hashtable<>();
97 map.put("_pt", pt);
98 map.put("_type", blockType);
99 map.put("_len", blockLen);
100 contents.add(map);
101 if (verbose)
102 System.out.println(map);
103 int remaining = readBlock(blockType, blockLen - 8, map);
104 if (remaining < 0) {
105 pt = -1;
106 return;
107 }
108 skip(remaining);
109 }
110
111 /**
112 * Read a block and return the number of remaining bytes, usually 0.

Callers 2

getContentsMethod · 0.95
readInnerMethod · 0.95

Calls 14

readIntMethod · 0.95
readStringMethod · 0.95
skipMethod · 0.95
readFTYPMethod · 0.95
readInnerMethod · 0.95
dumpMapMethod · 0.95
readMVHDMethod · 0.95
readTKHDMethod · 0.95
readSTSDMethod · 0.95
printlnMethod · 0.65
equalsMethod · 0.65
toHexStringMethod · 0.45

Tested by

no test coverage detected