MCPcopy Create free account
hub / github.com/Whiley/WhileyCompiler / readItems

Method readItems

src/main/java/wycc/io/HeapReader.java:54–69  ·  view source on GitHub ↗

Read all the items in this heap, returning the identified root item and an array of all items contained therein. @return @throws IOException

()

Source from the content-addressed store, hash-verified

52 * @throws IOException
53 */
54 protected Pair<Integer, Item[]> readItems() throws IOException {
55 // first, write magic number
56 Schema schema = checkHeader();
57 // second, determine number of items
58 int size = in.read_uv();
59 // third, determine the root item
60 int root = in.read_uv();
61 //
62 Bytecode[] items = new Bytecode[size];
63 // third, read abstract syntactic items
64 for (int i = 0; i != items.length; ++i) {
65 items[i] = readItem(schema);
66 }
67 //
68 return new Pair<>(root, constructItems(schema, items));
69 }
70
71 /**
72 * Check the header of this syntactic heap and, based on this, select the most

Callers 1

readMethod · 0.80

Calls 4

checkHeaderMethod · 0.95
readItemMethod · 0.95
constructItemsMethod · 0.95
read_uvMethod · 0.80

Tested by

no test coverage detected