@Test public void testReadFrom() throws Exception { header = new TlvHeader(); header.setTlvType(6); header.setTlvLength(4); channelBuffer = ChannelBuffers.copiedBuffer(packet); maximumReservableBandwidth = new MaximumReservableBandwidth(header); maximumReservableBandwidth.readFrom(channelBuffer); assertThat(maximumReservableBandwidth, is(notNullValue())); }
public void readFrom(ChannelBuffer channelBuffer) { byte[] tempByteArray = new byte[tlvLength()]; channelBuffer.readBytes(tempByteArray, 0, tlvLength()); int maxBandwidth = (OspfUtil.byteToInteger(tempByteArray)); this.setMaximumBandwidth(Float.intBitsToFloat(maxBandwidth)); }
MaximumReservableBandwidth extends TlvHeader implements LinkSubType { public void readFrom(ChannelBuffer channelBuffer) { byte[] tempByteArray = new byte[tlvLength()]; channelBuffer.readBytes(tempByteArray, 0, tlvLength()); int maxBandwidth = (OspfUtil.byteToInteger(tempByteArray)); this.setMaximumBandwidth(Float.intBitsToFloat(maxBandwidth)); } }
MaximumReservableBandwidth extends TlvHeader implements LinkSubType { public void readFrom(ChannelBuffer channelBuffer) { byte[] tempByteArray = new byte[tlvLength()]; channelBuffer.readBytes(tempByteArray, 0, tlvLength()); int maxBandwidth = (OspfUtil.byteToInteger(tempByteArray)); this.setMaximumBandwidth(Float.intBitsToFloat(maxBandwidth)); } MaximumReservableBandwidth(TlvHeader header); }
MaximumReservableBandwidth extends TlvHeader implements LinkSubType { public void readFrom(ChannelBuffer channelBuffer) { byte[] tempByteArray = new byte[tlvLength()]; channelBuffer.readBytes(tempByteArray, 0, tlvLength()); int maxBandwidth = (OspfUtil.byteToInteger(tempByteArray)); this.setMaximumBandwidth(Float.intBitsToFloat(maxBandwidth)); } MaximumReservableBandwidth(TlvHeader header); void setMaximumBandwidth(float maximumBandwidth); float getMaximumBandwidthValue(); void readFrom(ChannelBuffer channelBuffer); byte[] asBytes(); byte[] getLinksubTypeTlvBodyAsByteArray(); @Override String toString(); }
MaximumReservableBandwidth extends TlvHeader implements LinkSubType { public void readFrom(ChannelBuffer channelBuffer) { byte[] tempByteArray = new byte[tlvLength()]; channelBuffer.readBytes(tempByteArray, 0, tlvLength()); int maxBandwidth = (OspfUtil.byteToInteger(tempByteArray)); this.setMaximumBandwidth(Float.intBitsToFloat(maxBandwidth)); } MaximumReservableBandwidth(TlvHeader header); void setMaximumBandwidth(float maximumBandwidth); float getMaximumBandwidthValue(); void readFrom(ChannelBuffer channelBuffer); byte[] asBytes(); byte[] getLinksubTypeTlvBodyAsByteArray(); @Override String toString();  }