public CompiledClass(DataInputStream source) throws IOException {
  int idx;
  magic=(long)source.readInt();
  minor_version=source.readUnsignedShort();
  major_version=source.readUnsignedShort();
  constant_pool_count=source.readUnsignedShort();
  constant_pool=new Cp[constant_pool_count];
  constant_pool[0]=null;
  for (idx=1; idx < constant_pool_count; idx++) {
    constant_pool[idx]=Cp.readCp(source);
    if ((constant_pool[idx] instanceof CpLong) || (constant_pool[idx] instanceof CpDouble))     idx++;
  }
  access_flags=source.readUnsignedShort();
  this_class=source.readUnsignedShort();
  super_class=source.readUnsignedShort();
  interfaces_count=source.readUnsignedShort();
  interfaces=new int[interfaces_count];
  for (idx=0; idx < interfaces_count; idx++) {
    interfaces[idx]=source.readUnsignedShort();
  }
  fields_count=source.readUnsignedShort();
  fields=new CompiledField[fields_count];
  for (idx=0; idx < fields_count; idx++) {
    fields[idx]=new CompiledField(source,this);
  }
  methods_count=source.readUnsignedShort();
  methods=new CompiledMethod[methods_count];
  for (idx=0; idx < methods_count; idx++) {
    methods[idx]=new CompiledMethod(source,this);
  }
  attributes_count=source.readUnsignedShort();
  attributes=new CompiledAttribute[attributes_count];
  for (idx=0; idx < attributes_count; idx++) {
    attributes[idx]=new CompiledAttribute(source);
  }
}

public CompiledClass ( DataInputStream source ) throws IOException { int idx ; magic = ( long ) source . readInt ( ) ; minor_version = source . readUnsignedShort ( ) ; major_version = source . readUnsignedShort ( ) ; constant_pool_count = source . readUnsignedShort ( ) ; constant_pool = new Cp [ constant_pool_count ] ; constant_pool [ 0 ] = null ; for ( idx = 1 ; idx < constant_pool_count ; idx ++ ) { constant_pool [ idx ] = Cp . readCp ( source ) ; if ( ( constant_pool [ idx ] instanceof CpLong ) || ( constant_pool [ idx ] instanceof CpDouble ) ) idx ++ ; } access_flags = source . readUnsignedShort ( ) ; this_class = source . readUnsignedShort ( ) ; super_class = source . readUnsignedShort ( ) ; interfaces_count = source . readUnsignedShort ( ) ; interfaces = new int [ interfaces_count ] ; for ( idx = 0 ; idx < interfaces_count ; idx ++ ) { interfaces [ idx ] = source . readUnsignedShort ( ) ; } fields_count = source . readUnsignedShort ( ) ; fields = new CompiledField [ fields_count ] ; for ( idx = 0 ; idx < fields_count ; idx ++ ) { fields [ idx ] = new CompiledField ( source , this ) ; } methods_count = source . readUnsignedShort ( ) ; methods = new CompiledMethod [ methods_count ] ; for ( idx = 0 ; idx < methods_count ; idx ++ ) { methods [ idx ] = new CompiledMethod ( source , this ) ; } attributes_count = source . readUnsignedShort ( ) ; attributes = new CompiledAttribute [ attributes_count ] ; for ( idx = 0 ; idx < attributes_count ; idx ++ ) { attributes [ idx ] = new CompiledAttribute ( source ) ; } }
read a classfile structure from the given input source ( usually a file )
