@Test public void testReadFrom() throws Exception { channelBuffer = ChannelBuffers.copiedBuffer(tlv); areaAddressTlv.readFrom(channelBuffer); assertThat(areaAddressTlv.areaAddress().size(), is(1)); }
@Override public void readFrom(ChannelBuffer channelBuffer) { while (channelBuffer.readableBytes() > 0) { int addressLength = channelBuffer.readByte(); byte[] addressbytes = new byte[addressLength]; channelBuffer.readBytes(addressbytes, 0, addressLength); String areaAddress = IsisUtil.areaAddres(addressbytes); this.areaAddress.add(areaAddress); } }
AreaAddressTlv extends TlvHeader implements IsisTlv { @Override public void readFrom(ChannelBuffer channelBuffer) { while (channelBuffer.readableBytes() > 0) { int addressLength = channelBuffer.readByte(); byte[] addressbytes = new byte[addressLength]; channelBuffer.readBytes(addressbytes, 0, addressLength); String areaAddress = IsisUtil.areaAddres(addressbytes); this.areaAddress.add(areaAddress); } } }
AreaAddressTlv extends TlvHeader implements IsisTlv { @Override public void readFrom(ChannelBuffer channelBuffer) { while (channelBuffer.readableBytes() > 0) { int addressLength = channelBuffer.readByte(); byte[] addressbytes = new byte[addressLength]; channelBuffer.readBytes(addressbytes, 0, addressLength); String areaAddress = IsisUtil.areaAddres(addressbytes); this.areaAddress.add(areaAddress); } } AreaAddressTlv(TlvHeader tlvHeader); }
AreaAddressTlv extends TlvHeader implements IsisTlv { @Override public void readFrom(ChannelBuffer channelBuffer) { while (channelBuffer.readableBytes() > 0) { int addressLength = channelBuffer.readByte(); byte[] addressbytes = new byte[addressLength]; channelBuffer.readBytes(addressbytes, 0, addressLength); String areaAddress = IsisUtil.areaAddres(addressbytes); this.areaAddress.add(areaAddress); } } AreaAddressTlv(TlvHeader tlvHeader); void addAddress(String areaAddress); List<String> areaAddress(); @Override void readFrom(ChannelBuffer channelBuffer); @Override byte[] asBytes(); @Override String toString(); }
AreaAddressTlv extends TlvHeader implements IsisTlv { @Override public void readFrom(ChannelBuffer channelBuffer) { while (channelBuffer.readableBytes() > 0) { int addressLength = channelBuffer.readByte(); byte[] addressbytes = new byte[addressLength]; channelBuffer.readBytes(addressbytes, 0, addressLength); String areaAddress = IsisUtil.areaAddres(addressbytes); this.areaAddress.add(areaAddress); } } AreaAddressTlv(TlvHeader tlvHeader); void addAddress(String areaAddress); List<String> areaAddress(); @Override void readFrom(ChannelBuffer channelBuffer); @Override byte[] asBytes(); @Override String toString();  }