@Test public void testReadFrom() throws Exception { channelBuffer = ChannelBuffers.copiedBuffer(psnpPkt); psnp.readFrom(channelBuffer); assertThat(psnp, is(notNullValue())); }
@Override public void readFrom(ChannelBuffer channelBuffer) { this.setPduLength(channelBuffer.readUnsignedShort()); byte[] tempByteArray = new byte[IsisUtil.ID_PLUS_ONE_BYTE]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_PLUS_ONE_BYTE); this.setSourceId(IsisUtil.systemIdPlus(tempByteArray)); while (channelBuffer.readableBytes() > 0) { TlvHeader tlvHeader = new TlvHeader(); tlvHeader.setTlvType(channelBuffer.readUnsignedByte()); tlvHeader.setTlvLength(channelBuffer.readUnsignedByte()); TlvType tlvValue = TlvType.get(tlvHeader.tlvType()); if (tlvValue != null) { IsisTlv tlv = TlvFinder.findTlv(tlvHeader, channelBuffer.readBytes(tlvHeader.tlvLength())); if (tlv != null) { this.variableLengths.add(tlv); } } else { channelBuffer.readBytes(tlvHeader.tlvLength()); } } }
Psnp extends IsisHeader { @Override public void readFrom(ChannelBuffer channelBuffer) { this.setPduLength(channelBuffer.readUnsignedShort()); byte[] tempByteArray = new byte[IsisUtil.ID_PLUS_ONE_BYTE]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_PLUS_ONE_BYTE); this.setSourceId(IsisUtil.systemIdPlus(tempByteArray)); while (channelBuffer.readableBytes() > 0) { TlvHeader tlvHeader = new TlvHeader(); tlvHeader.setTlvType(channelBuffer.readUnsignedByte()); tlvHeader.setTlvLength(channelBuffer.readUnsignedByte()); TlvType tlvValue = TlvType.get(tlvHeader.tlvType()); if (tlvValue != null) { IsisTlv tlv = TlvFinder.findTlv(tlvHeader, channelBuffer.readBytes(tlvHeader.tlvLength())); if (tlv != null) { this.variableLengths.add(tlv); } } else { channelBuffer.readBytes(tlvHeader.tlvLength()); } } } }
Psnp extends IsisHeader { @Override public void readFrom(ChannelBuffer channelBuffer) { this.setPduLength(channelBuffer.readUnsignedShort()); byte[] tempByteArray = new byte[IsisUtil.ID_PLUS_ONE_BYTE]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_PLUS_ONE_BYTE); this.setSourceId(IsisUtil.systemIdPlus(tempByteArray)); while (channelBuffer.readableBytes() > 0) { TlvHeader tlvHeader = new TlvHeader(); tlvHeader.setTlvType(channelBuffer.readUnsignedByte()); tlvHeader.setTlvLength(channelBuffer.readUnsignedByte()); TlvType tlvValue = TlvType.get(tlvHeader.tlvType()); if (tlvValue != null) { IsisTlv tlv = TlvFinder.findTlv(tlvHeader, channelBuffer.readBytes(tlvHeader.tlvLength())); if (tlv != null) { this.variableLengths.add(tlv); } } else { channelBuffer.readBytes(tlvHeader.tlvLength()); } } } Psnp(IsisHeader isisHeader); }
Psnp extends IsisHeader { @Override public void readFrom(ChannelBuffer channelBuffer) { this.setPduLength(channelBuffer.readUnsignedShort()); byte[] tempByteArray = new byte[IsisUtil.ID_PLUS_ONE_BYTE]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_PLUS_ONE_BYTE); this.setSourceId(IsisUtil.systemIdPlus(tempByteArray)); while (channelBuffer.readableBytes() > 0) { TlvHeader tlvHeader = new TlvHeader(); tlvHeader.setTlvType(channelBuffer.readUnsignedByte()); tlvHeader.setTlvLength(channelBuffer.readUnsignedByte()); TlvType tlvValue = TlvType.get(tlvHeader.tlvType()); if (tlvValue != null) { IsisTlv tlv = TlvFinder.findTlv(tlvHeader, channelBuffer.readBytes(tlvHeader.tlvLength())); if (tlv != null) { this.variableLengths.add(tlv); } } else { channelBuffer.readBytes(tlvHeader.tlvLength()); } } } Psnp(IsisHeader isisHeader); void addTlv(IsisTlv isisTlv); List<IsisTlv> getAllTlv(); String sourceId(); void setSourceId(String sourceId); int pduLength(); void setPduLength(int pduLength); @Override void readFrom(ChannelBuffer channelBuffer); @Override byte[] asBytes(); byte[] isisPduHeader(); byte[] partialSequenceNumberPduBody(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
Psnp extends IsisHeader { @Override public void readFrom(ChannelBuffer channelBuffer) { this.setPduLength(channelBuffer.readUnsignedShort()); byte[] tempByteArray = new byte[IsisUtil.ID_PLUS_ONE_BYTE]; channelBuffer.readBytes(tempByteArray, 0, IsisUtil.ID_PLUS_ONE_BYTE); this.setSourceId(IsisUtil.systemIdPlus(tempByteArray)); while (channelBuffer.readableBytes() > 0) { TlvHeader tlvHeader = new TlvHeader(); tlvHeader.setTlvType(channelBuffer.readUnsignedByte()); tlvHeader.setTlvLength(channelBuffer.readUnsignedByte()); TlvType tlvValue = TlvType.get(tlvHeader.tlvType()); if (tlvValue != null) { IsisTlv tlv = TlvFinder.findTlv(tlvHeader, channelBuffer.readBytes(tlvHeader.tlvLength())); if (tlv != null) { this.variableLengths.add(tlv); } } else { channelBuffer.readBytes(tlvHeader.tlvLength()); } } } Psnp(IsisHeader isisHeader); void addTlv(IsisTlv isisTlv); List<IsisTlv> getAllTlv(); String sourceId(); void setSourceId(String sourceId); int pduLength(); void setPduLength(int pduLength); @Override void readFrom(ChannelBuffer channelBuffer); @Override byte[] asBytes(); byte[] isisPduHeader(); byte[] partialSequenceNumberPduBody(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }