Read the input channel and initialize instance data
structure.
/**
* this is the .class file layout
*
ClassFile {
u4 magic;
u2 minor_version;
u2 major_version;
u2 constant_pool_count;
cp_info constant_pool[constant_pool_count-1];
u2 access_flags;
u2 this_class;
u2 super_class;
u2 interfaces_count;
u2 interfaces[interfaces_count];
u2 fields_count;
field_info fields[fields_count];
u2 methods_count;
method_info methods[methods_count];
u2 attributes_count;
attribute_info attributes[attributes_count];
}
**/
header.clear();
if (size!=-1 && size>header.capacity()) {
// time to expand...
header = ByteBuffer.allocate((int) size);
}
long read = (long) in.read(header);
if (size!=-1 && read!=size) {
return false;
}
header.rewind();
if (header.getInt()!=magic) {
return false;
}
majorVersion = header.getShort();
minorVersion = header.getShort();
int constantPoolSize = header.getShort();
return constantPoolInfo.containsAnnotation(constantPoolSize, header);