@Test public void testReadFrom() throws Exception { channelBuffer = ChannelBuffers.copiedBuffer(p2p); p2PHelloPdu.readFrom(channelBuffer); assertThat(p2PHelloPdu, is(notNullValue())); }
@Override public void readFrom(ChannelBuffer channelBuffer) { this.setCircuitType(channelBuffer.readByte()); byte[] tempByteArray = new byte[IsisUtil.ID_SIX_BYTES]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_SIX_BYTES); this.setSourceId(IsisUtil.systemId(tempByteArray)); this.setHoldingTime(channelBuffer.readUnsignedShort()); this.setPduLength(channelBuffer.readUnsignedShort()); this.setLocalCircuitId((byte) channelBuffer.readUnsignedByte()); while (channelBuffer.readableBytes() > 0) { TlvHeader tlvHeader = new TlvHeader(); tlvHeader.setTlvType(channelBuffer.readUnsignedByte()); tlvHeader.setTlvLength(channelBuffer.readUnsignedByte()); TlvType tlvType = TlvType.get(tlvHeader.tlvType()); if (tlvType != null) { IsisTlv tlv = TlvFinder.findTlv(tlvHeader, channelBuffer.readBytes(tlvHeader.tlvLength())); if (tlv != null) { this.variableLengths.add(tlv); } } else { channelBuffer.readBytes(tlvHeader.tlvLength()); } } }
P2PHelloPdu extends HelloPdu { @Override public void readFrom(ChannelBuffer channelBuffer) { this.setCircuitType(channelBuffer.readByte()); byte[] tempByteArray = new byte[IsisUtil.ID_SIX_BYTES]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_SIX_BYTES); this.setSourceId(IsisUtil.systemId(tempByteArray)); this.setHoldingTime(channelBuffer.readUnsignedShort()); this.setPduLength(channelBuffer.readUnsignedShort()); this.setLocalCircuitId((byte) channelBuffer.readUnsignedByte()); while (channelBuffer.readableBytes() > 0) { TlvHeader tlvHeader = new TlvHeader(); tlvHeader.setTlvType(channelBuffer.readUnsignedByte()); tlvHeader.setTlvLength(channelBuffer.readUnsignedByte()); TlvType tlvType = TlvType.get(tlvHeader.tlvType()); if (tlvType != null) { IsisTlv tlv = TlvFinder.findTlv(tlvHeader, channelBuffer.readBytes(tlvHeader.tlvLength())); if (tlv != null) { this.variableLengths.add(tlv); } } else { channelBuffer.readBytes(tlvHeader.tlvLength()); } } } }
P2PHelloPdu extends HelloPdu { @Override public void readFrom(ChannelBuffer channelBuffer) { this.setCircuitType(channelBuffer.readByte()); byte[] tempByteArray = new byte[IsisUtil.ID_SIX_BYTES]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_SIX_BYTES); this.setSourceId(IsisUtil.systemId(tempByteArray)); this.setHoldingTime(channelBuffer.readUnsignedShort()); this.setPduLength(channelBuffer.readUnsignedShort()); this.setLocalCircuitId((byte) channelBuffer.readUnsignedByte()); while (channelBuffer.readableBytes() > 0) { TlvHeader tlvHeader = new TlvHeader(); tlvHeader.setTlvType(channelBuffer.readUnsignedByte()); tlvHeader.setTlvLength(channelBuffer.readUnsignedByte()); TlvType tlvType = TlvType.get(tlvHeader.tlvType()); if (tlvType != null) { IsisTlv tlv = TlvFinder.findTlv(tlvHeader, channelBuffer.readBytes(tlvHeader.tlvLength())); if (tlv != null) { this.variableLengths.add(tlv); } } else { channelBuffer.readBytes(tlvHeader.tlvLength()); } } } P2PHelloPdu(IsisHeader isisHeader); }
P2PHelloPdu extends HelloPdu { @Override public void readFrom(ChannelBuffer channelBuffer) { this.setCircuitType(channelBuffer.readByte()); byte[] tempByteArray = new byte[IsisUtil.ID_SIX_BYTES]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_SIX_BYTES); this.setSourceId(IsisUtil.systemId(tempByteArray)); this.setHoldingTime(channelBuffer.readUnsignedShort()); this.setPduLength(channelBuffer.readUnsignedShort()); this.setLocalCircuitId((byte) channelBuffer.readUnsignedByte()); while (channelBuffer.readableBytes() > 0) { TlvHeader tlvHeader = new TlvHeader(); tlvHeader.setTlvType(channelBuffer.readUnsignedByte()); tlvHeader.setTlvLength(channelBuffer.readUnsignedByte()); TlvType tlvType = TlvType.get(tlvHeader.tlvType()); if (tlvType != null) { IsisTlv tlv = TlvFinder.findTlv(tlvHeader, channelBuffer.readBytes(tlvHeader.tlvLength())); if (tlv != null) { this.variableLengths.add(tlv); } } else { channelBuffer.readBytes(tlvHeader.tlvLength()); } } } P2PHelloPdu(IsisHeader isisHeader); byte localCircuitId(); void setLocalCircuitId(byte localCircuitId); void setVariableLengths(List<IsisTlv> variableLengths); @Override void readFrom(ChannelBuffer channelBuffer); @Override byte[] asBytes(); byte[] p2PHeader(); byte[] p2P2HelloPduBody(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
P2PHelloPdu extends HelloPdu { @Override public void readFrom(ChannelBuffer channelBuffer) { this.setCircuitType(channelBuffer.readByte()); byte[] tempByteArray = new byte[IsisUtil.ID_SIX_BYTES]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_SIX_BYTES); this.setSourceId(IsisUtil.systemId(tempByteArray)); this.setHoldingTime(channelBuffer.readUnsignedShort()); this.setPduLength(channelBuffer.readUnsignedShort()); this.setLocalCircuitId((byte) channelBuffer.readUnsignedByte()); while (channelBuffer.readableBytes() > 0) { TlvHeader tlvHeader = new TlvHeader(); tlvHeader.setTlvType(channelBuffer.readUnsignedByte()); tlvHeader.setTlvLength(channelBuffer.readUnsignedByte()); TlvType tlvType = TlvType.get(tlvHeader.tlvType()); if (tlvType != null) { IsisTlv tlv = TlvFinder.findTlv(tlvHeader, channelBuffer.readBytes(tlvHeader.tlvLength())); if (tlv != null) { this.variableLengths.add(tlv); } } else { channelBuffer.readBytes(tlvHeader.tlvLength()); } } } P2PHelloPdu(IsisHeader isisHeader); byte localCircuitId(); void setLocalCircuitId(byte localCircuitId); void setVariableLengths(List<IsisTlv> variableLengths); @Override void readFrom(ChannelBuffer channelBuffer); @Override byte[] asBytes(); byte[] p2PHeader(); byte[] p2P2HelloPduBody(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }