private Code readCode() {
int registersSize = readUnsignedShort();
int insSize = readUnsignedShort();
int outsSize = readUnsignedShort();
int triesSize = readUnsignedShort();
int debugInfoOffset = readInt();
int instructionsSize = readInt();
short[] instructions = readShortArray(instructionsSize);
Code.Try[] tries = new Code.Try[triesSize];
Code.CatchHandler[] catchHandlers = new Code.CatchHandler[0];
if (triesSize > 0) {
if (instructions.length % 2 == 1) {
readShort();
}
for (int i = 0; i < triesSize; i++) {
int startAddress = readInt();
int instructionCount = readUnsignedShort();
int handlerOffset = readUnsignedShort();
tries[i] = new Code.Try(startAddress, instructionCount, handlerOffset);
}
int catchHandlersSize = readUleb128();
catchHandlers = new Code.CatchHandler[catchHandlersSize];
for (int i = 0; i < catchHandlersSize; i++) {
catchHandlers[i] = readCatchHandler();
}
}
return new Code(registersSize, insSize, outsSize, debugInfoOffset, instructions,
tries, catchHandlers);
}