@Test public void testReadFrom() throws Exception { header = new TlvHeader(); header.setTlvLength(4); header.setTlvType(5); channelBuffer = ChannelBuffers.copiedBuffer(packet); trafficEngineeringMetric = new TrafficEngineeringMetric(header); trafficEngineeringMetric.readFrom(channelBuffer); assertThat(trafficEngineeringMetric, is(notNullValue())); }
public void readFrom(ChannelBuffer channelBuffer) { byte[] tempByteArray = new byte[tlvLength()]; channelBuffer.readBytes(tempByteArray, 0, tlvLength()); this.setTrafficEngineeringMetric(OspfUtil.byteToLong(tempByteArray)); }
TrafficEngineeringMetric extends TlvHeader implements LinkSubType { public void readFrom(ChannelBuffer channelBuffer) { byte[] tempByteArray = new byte[tlvLength()]; channelBuffer.readBytes(tempByteArray, 0, tlvLength()); this.setTrafficEngineeringMetric(OspfUtil.byteToLong(tempByteArray)); } }
TrafficEngineeringMetric extends TlvHeader implements LinkSubType { public void readFrom(ChannelBuffer channelBuffer) { byte[] tempByteArray = new byte[tlvLength()]; channelBuffer.readBytes(tempByteArray, 0, tlvLength()); this.setTrafficEngineeringMetric(OspfUtil.byteToLong(tempByteArray)); } TrafficEngineeringMetric(TlvHeader header); }
TrafficEngineeringMetric extends TlvHeader implements LinkSubType { public void readFrom(ChannelBuffer channelBuffer) { byte[] tempByteArray = new byte[tlvLength()]; channelBuffer.readBytes(tempByteArray, 0, tlvLength()); this.setTrafficEngineeringMetric(OspfUtil.byteToLong(tempByteArray)); } TrafficEngineeringMetric(TlvHeader header); void setTrafficEngineeringMetric(long trafficEngineeringMetric); long getTrafficEngineeringMetricValue(); void readFrom(ChannelBuffer channelBuffer); byte[] asBytes(); byte[] getLinkSubTypeTlvBodyAsByteArray(); @Override String toString(); }
TrafficEngineeringMetric extends TlvHeader implements LinkSubType { public void readFrom(ChannelBuffer channelBuffer) { byte[] tempByteArray = new byte[tlvLength()]; channelBuffer.readBytes(tempByteArray, 0, tlvLength()); this.setTrafficEngineeringMetric(OspfUtil.byteToLong(tempByteArray)); } TrafficEngineeringMetric(TlvHeader header); void setTrafficEngineeringMetric(long trafficEngineeringMetric); long getTrafficEngineeringMetricValue(); void readFrom(ChannelBuffer channelBuffer); byte[] asBytes(); byte[] getLinkSubTypeTlvBodyAsByteArray(); @Override String toString();  }