@Test public void testReadFrom() { tlvHeader = new TlvHeader(); tlvHeader.setTlvType(3); tlvHeader.setTlvLength(4); interfaceIpAddress = new NeighborIpAddress(tlvHeader); channelBuffer = ChannelBuffers.copiedBuffer(packet); interfaceIpAddress.readFrom(channelBuffer); assertThat(interfaceIpAddress, is(notNullValue())); }
public void readFrom(ChannelBuffer channelBuffer) { while (channelBuffer.readableBytes() >= IsisUtil.FOUR_BYTES) { byte[] tempByteArray = new byte[IsisUtil.FOUR_BYTES]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.FOUR_BYTES); this.setIpAddress(Ip4Address.valueOf(tempByteArray)); } }
InterfaceIpAddress extends TlvHeader implements TrafficEngineeringSubTlv { public void readFrom(ChannelBuffer channelBuffer) { while (channelBuffer.readableBytes() >= IsisUtil.FOUR_BYTES) { byte[] tempByteArray = new byte[IsisUtil.FOUR_BYTES]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.FOUR_BYTES); this.setIpAddress(Ip4Address.valueOf(tempByteArray)); } } }
InterfaceIpAddress extends TlvHeader implements TrafficEngineeringSubTlv { public void readFrom(ChannelBuffer channelBuffer) { while (channelBuffer.readableBytes() >= IsisUtil.FOUR_BYTES) { byte[] tempByteArray = new byte[IsisUtil.FOUR_BYTES]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.FOUR_BYTES); this.setIpAddress(Ip4Address.valueOf(tempByteArray)); } } InterfaceIpAddress(TlvHeader header); }
InterfaceIpAddress extends TlvHeader implements TrafficEngineeringSubTlv { public void readFrom(ChannelBuffer channelBuffer) { while (channelBuffer.readableBytes() >= IsisUtil.FOUR_BYTES) { byte[] tempByteArray = new byte[IsisUtil.FOUR_BYTES]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.FOUR_BYTES); this.setIpAddress(Ip4Address.valueOf(tempByteArray)); } } InterfaceIpAddress(TlvHeader header); void setIpAddress(Ip4Address localAddress); Ip4Address localInterfaceIPAddress(); void readFrom(ChannelBuffer channelBuffer); byte[] asBytes(); byte[] tlvBodyAsBytes(); @Override String toString(); }
InterfaceIpAddress extends TlvHeader implements TrafficEngineeringSubTlv { public void readFrom(ChannelBuffer channelBuffer) { while (channelBuffer.readableBytes() >= IsisUtil.FOUR_BYTES) { byte[] tempByteArray = new byte[IsisUtil.FOUR_BYTES]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.FOUR_BYTES); this.setIpAddress(Ip4Address.valueOf(tempByteArray)); } } InterfaceIpAddress(TlvHeader header); void setIpAddress(Ip4Address localAddress); Ip4Address localInterfaceIPAddress(); void readFrom(ChannelBuffer channelBuffer); byte[] asBytes(); byte[] tlvBodyAsBytes(); @Override String toString();  }