AnnotationEntry(final DataInput input, final ConstantPool constant_pool) throws IOException { this.constant_pool = constant_pool; type_index = input.readUnsignedShort(); final int num_element_value_pairs = input.readUnsignedShort(); element_value_pairs = new ArrayList<>(num_element_value_pairs); for (int i = 0; i < num_element_value_pairs; i++) { element_value_pairs.add(new ElementValuePair(input, constant_pool)); } }
/** * Factory method to create an AnnotionEntry from a DataInputStream * * @param file * @param constant_pool * @return the entry * @throws IOException */ public static AnnotationEntry read(DataInputStream file, ConstantPool constant_pool) throws IOException { final AnnotationEntry annotationEntry = new AnnotationEntry(file.readUnsignedShort(), constant_pool); final int num_element_value_pairs = (file.readUnsignedShort()); annotationEntry.element_value_pairs = new ArrayList<>(); for (int i = 0; i < num_element_value_pairs; i++) { annotationEntry.element_value_pairs.add(new ElementValuePair(file.readUnsignedShort(), ElementValue.readElementValue(file, constant_pool), constant_pool)); } return annotationEntry; }
/** * Factory method to create an AnnotionEntry from a DataInputStream * * @param file * @param constant_pool * @throws IOException */ public static AnnotationEntry read(DataInputStream file, ConstantPool constant_pool) throws IOException { final AnnotationEntry annotationEntry = new AnnotationEntry(file.readUnsignedShort(), constant_pool); final int num_element_value_pairs = (file.readUnsignedShort()); annotationEntry.element_value_pairs = new ArrayList<ElementValuePair>(); for (int i = 0; i < num_element_value_pairs; i++) { annotationEntry.element_value_pairs.add(new ElementValuePair(file.readUnsignedShort(), ElementValue.readElementValue(file, constant_pool), constant_pool)); } return annotationEntry; }
/** * Factory method to create an AnnotionEntry from a DataInputStream * * @param file * @param constant_pool * @return the entry * @throws IOException */ public static AnnotationEntry read(DataInputStream file, ConstantPool constant_pool) throws IOException { final AnnotationEntry annotationEntry = new AnnotationEntry(file.readUnsignedShort(), constant_pool); final int num_element_value_pairs = (file.readUnsignedShort()); annotationEntry.element_value_pairs = new ArrayList<ElementValuePair>(); for (int i = 0; i < num_element_value_pairs; i++) { annotationEntry.element_value_pairs.add(new ElementValuePair(file.readUnsignedShort(), ElementValue.readElementValue(file, constant_pool), constant_pool)); } return annotationEntry; }
/** * Factory method to create an AnnotionEntry from a DataInputStream * * @param file * @param constant_pool * @return the entry * @throws IOException */ public static AnnotationEntry read(DataInputStream file, ConstantPool constant_pool) throws IOException { final AnnotationEntry annotationEntry = new AnnotationEntry(file.readUnsignedShort(), constant_pool); final int num_element_value_pairs = (file.readUnsignedShort()); annotationEntry.element_value_pairs = new ArrayList<ElementValuePair>(); for (int i = 0; i < num_element_value_pairs; i++) { annotationEntry.element_value_pairs.add(new ElementValuePair(file.readUnsignedShort(), ElementValue.readElementValue(file, constant_pool), constant_pool)); } return annotationEntry; }