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

Method readData

src/main/java/wycc/io/HeapReader.java:116–137  ·  view source on GitHub ↗
(Schema schema, int opcode)

Source from the content-addressed store, hash-verified

114 }
115
116 protected byte[] readData(Schema schema, int opcode) throws IOException {
117 // Determine operand layout
118 Item.Data layout = schema.getDescriptor(opcode).getDataLayout();
119 byte[] bytes;
120 int size;
121 // Determine number of bytes according to layout
122 switch(layout) {
123 case MANY:
124 size = in.read_uv();
125 break;
126 default:
127 size = layout.ordinal();
128 }
129 //
130 bytes = new byte[size];
131 // Read operands
132 for (int i = 0; i != bytes.length; ++i) {
133 bytes[i] = (byte) in.read_u8();
134 }
135 //
136 return bytes;
137 }
138
139 protected Item[] constructItems(Schema schema, Bytecode[] bytecodes) {
140 Item[] items = new Item[bytecodes.length];

Callers 1

readItemMethod · 0.95

Calls 4

getDataLayoutMethod · 0.80
read_uvMethod · 0.80
read_u8Method · 0.80
getDescriptorMethod · 0.65

Tested by

no test coverage detected