Code example for DataInputStream

Methods: read, readInt, readUnsignedShort

0
	private int nameIndex;
	private byte[] info;
	private String attributeName;
 
	public AttributeInfo(ConstantPool constantPool, DataInputStream dis) throws IOException {
		nameIndex = dis.readUnsignedShort();
		int attrLength = dis.readInt();
		info = new byte[attrLength];
		dis.read(info);
		 
		attributeName = constantPool.getUTF8Info(nameIndex).getValue();
	} 
	 
	public int getNameIndex() { 
		return nameIndex;
	} 
	 
	public String getAttributeName() {
		return attributeName;
	}