*
* @throws java.io.IOException
*/
public InterfaceInfo load(byte bitfield, CapInputStream in) throws UnableToReadCapFileException {
InterfaceInfo interfaceInfo = new InterfaceInfo();
interfaceInfo.setBitfield(bitfield);
// the number of entries entries in the SuperInterfaces array
// is in the second nibble of the bitField
byte interfaceCount = (byte) (bitfield & 0x0F);
// superInterfaces loading
interfaceInfo.getSuperInterfaces().clear();
for (int i = 0; i < interfaceCount; i++) {
ClassRef c = new ClassRefRead().load(in);
interfaceInfo.getSuperInterfaces().add(c);
}
// intefaceNameInfo loading (only if the bit remote is set in the flag)
if ((bitfield & ClassComponent.ACC_REMOTE) >>> 5 == ClassComponent.ACC_REMOTE) {
interfaceInfo.setInterfaceNameInfo(new InterfaceNameInfoRead().load(in));
}
{
interfaceInfo.setInterfaceNameInfo(new InterfaceNameInfo());
}
return interfaceInfo;
}