/** * Class method reads one attribute from the input data stream. This method * must not be accessible from the outside. It is called by the Field and * Method constructor methods. * * @see Field * @see Method * * @param file Input stream * @param constant_pool Array of constants * @return Attribute * @throws IOException * @throws ClassFormatException */ public static Attribute readAttribute(final DataInputStream file, final ConstantPool constant_pool) throws IOException, ClassFormatException { return readAttribute((DataInput) file, constant_pool); }
/** * Read information about the attributes of the class. * @throws IOException * @throws ClassFormatException */ private void readAttributes() throws IOException, ClassFormatException { final int attributes_count = dataInputStream.readUnsignedShort(); attributes = new Attribute[attributes_count]; for (int i = 0; i < attributes_count; i++) { attributes[i] = Attribute.readAttribute(dataInputStream, constant_pool); } }
/** * Read information about the attributes of the class. * @throws IOException * @throws ClassFormatException */ private final void readAttributes() throws IOException, ClassFormatException { int attributes_count; attributes_count = file.readUnsignedShort(); attributes = new Attribute[attributes_count]; for(int i=0; i < attributes_count; i++) attributes[i] = Attribute.readAttribute(file, constant_pool); }
/** * Construct object from file stream. * @param file Input stream * @throws IOException * @throws ClassFormatException */ protected FieldOrMethod(final DataInput file, final ConstantPool constant_pool) throws IOException, ClassFormatException { this(file.readUnsignedShort(), file.readUnsignedShort(), file.readUnsignedShort(), null, constant_pool); final int attributes_count = file.readUnsignedShort(); attributes = new Attribute[attributes_count]; for (int i = 0; i < attributes_count; i++) { attributes[i] = Attribute.readAttribute(file, constant_pool); } this.attributes_count = attributes_count; // init deprecated field }
/** * Construct object from file stream. * @param file Input stream * @throws IOException * @throws ClassFormatException */ protected FieldOrMethod(DataInputStream file, ConstantPool constant_pool) throws IOException, ClassFormatException { this(file.readUnsignedShort(), file.readUnsignedShort(), file.readUnsignedShort(), null, constant_pool); attributes_count = file.readUnsignedShort(); attributes = new Attribute[attributes_count]; for(int i=0; i < attributes_count; i++) attributes[i] = Attribute.readAttribute(file, constant_pool); }
attributes = new Attribute[attributes_count]; for(int i=0; i < attributes_count; i++) attributes[i] = Attribute.readAttribute(file, constant_pool);
attributes = new Attribute[attributes_count]; for (int i = 0; i < attributes_count; i++) { attributes[i] = Attribute.readAttribute(file, constant_pool);