@Test public void testReadFrom() throws Exception { tlvHeader = new TlvHeader(); tlvHeader.setTlvType(9); tlvHeader.setTlvLength(4); administrativeGroup = new AdministrativeGroup(tlvHeader); channelBuffer = ChannelBuffers.copiedBuffer(packet); administrativeGroup.readFrom(channelBuffer); assertThat(administrativeGroup.administrativeGroup(), is(notNullValue())); }
public void readFrom(ChannelBuffer channelBuffer) { byte[] tempByteArray = new byte[tlvLength()]; channelBuffer.readBytes(tempByteArray, 0, tlvLength()); this.setAdministrativeGroup(OspfUtil.byteToInteger(tempByteArray)); }
AdministrativeGroup extends TlvHeader implements LinkSubType { public void readFrom(ChannelBuffer channelBuffer) { byte[] tempByteArray = new byte[tlvLength()]; channelBuffer.readBytes(tempByteArray, 0, tlvLength()); this.setAdministrativeGroup(OspfUtil.byteToInteger(tempByteArray)); } }
AdministrativeGroup extends TlvHeader implements LinkSubType { public void readFrom(ChannelBuffer channelBuffer) { byte[] tempByteArray = new byte[tlvLength()]; channelBuffer.readBytes(tempByteArray, 0, tlvLength()); this.setAdministrativeGroup(OspfUtil.byteToInteger(tempByteArray)); } AdministrativeGroup(TlvHeader header); }
AdministrativeGroup extends TlvHeader implements LinkSubType { public void readFrom(ChannelBuffer channelBuffer) { byte[] tempByteArray = new byte[tlvLength()]; channelBuffer.readBytes(tempByteArray, 0, tlvLength()); this.setAdministrativeGroup(OspfUtil.byteToInteger(tempByteArray)); } AdministrativeGroup(TlvHeader header); int administrativeGroup(); void setAdministrativeGroup(int administrativeGroup); int getAdministrativeGroupValue(); void readFrom(ChannelBuffer channelBuffer); byte[] asBytes(); byte[] getLinkSubTypeTlvBodyAsByteArray(); @Override String toString(); }
AdministrativeGroup extends TlvHeader implements LinkSubType { public void readFrom(ChannelBuffer channelBuffer) { byte[] tempByteArray = new byte[tlvLength()]; channelBuffer.readBytes(tempByteArray, 0, tlvLength()); this.setAdministrativeGroup(OspfUtil.byteToInteger(tempByteArray)); } AdministrativeGroup(TlvHeader header); int administrativeGroup(); void setAdministrativeGroup(int administrativeGroup); int getAdministrativeGroupValue(); void readFrom(ChannelBuffer channelBuffer); byte[] asBytes(); byte[] getLinkSubTypeTlvBodyAsByteArray(); @Override String toString();  }