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