@Test public void testDecode() throws Exception { AttributeList attributes = AttributeList.decode(new byte[] {80, 6, 4, 2, 0, 1, 0, 80, 7, 4, 0, 10, 0, 20}); assertNotNull(attributes.get(AttributeType.Capabilities)); assertNotNull(attributes.get(AttributeType.HoldTime)); }
public static AttributeList decode(byte[] array) throws AttributeLengthException, AddressLengthException, UnknownNodeIdException, TlvNotFoundException, UnknownPrefixException, UnknownHostException, AttributeVariantException { AttributeList attributes = new AttributeList(); while (array.length != 0) { Attribute attribute = AttributeFactory.decode(array); attributes.add(attribute); array = ArraysUtil.readBytes(array, attribute.getLength()); } return attributes; }
AttributeList extends ArrayList<Attribute> { public static AttributeList decode(byte[] array) throws AttributeLengthException, AddressLengthException, UnknownNodeIdException, TlvNotFoundException, UnknownPrefixException, UnknownHostException, AttributeVariantException { AttributeList attributes = new AttributeList(); while (array.length != 0) { Attribute attribute = AttributeFactory.decode(array); attributes.add(attribute); array = ArraysUtil.readBytes(array, attribute.getLength()); } return attributes; } }
AttributeList extends ArrayList<Attribute> { public static AttributeList decode(byte[] array) throws AttributeLengthException, AddressLengthException, UnknownNodeIdException, TlvNotFoundException, UnknownPrefixException, UnknownHostException, AttributeVariantException { AttributeList attributes = new AttributeList(); while (array.length != 0) { Attribute attribute = AttributeFactory.decode(array); attributes.add(attribute); array = ArraysUtil.readBytes(array, attribute.getLength()); } return attributes; } AttributeList(); private  AttributeList(List<Attribute> attributes); }
AttributeList extends ArrayList<Attribute> { public static AttributeList decode(byte[] array) throws AttributeLengthException, AddressLengthException, UnknownNodeIdException, TlvNotFoundException, UnknownPrefixException, UnknownHostException, AttributeVariantException { AttributeList attributes = new AttributeList(); while (array.length != 0) { Attribute attribute = AttributeFactory.decode(array); attributes.add(attribute); array = ArraysUtil.readBytes(array, attribute.getLength()); } return attributes; } AttributeList(); private  AttributeList(List<Attribute> attributes); static AttributeList create(List<Attribute> list); static AttributeList decode(byte[] array); static AttributeOptionalFields get(List<Attribute> attributes, AttributeType type); AttributeOptionalFields get(AttributeType type); byte[] toBytes(); }
AttributeList extends ArrayList<Attribute> { public static AttributeList decode(byte[] array) throws AttributeLengthException, AddressLengthException, UnknownNodeIdException, TlvNotFoundException, UnknownPrefixException, UnknownHostException, AttributeVariantException { AttributeList attributes = new AttributeList(); while (array.length != 0) { Attribute attribute = AttributeFactory.decode(array); attributes.add(attribute); array = ArraysUtil.readBytes(array, attribute.getLength()); } return attributes; } AttributeList(); private  AttributeList(List<Attribute> attributes); static AttributeList create(List<Attribute> list); static AttributeList decode(byte[] array); static AttributeOptionalFields get(List<Attribute> attributes, AttributeType type); AttributeOptionalFields get(AttributeType type); byte[] toBytes();  }