@Test public void testDeserialize() throws Exception { ICMP icmp = deserializer.deserialize(headerBytes, 0, headerBytes.length); assertEquals(icmpType, icmp.getIcmpType()); assertEquals(icmpCode, icmp.getIcmpCode()); assertEquals(checksum, icmp.getChecksum()); }
@Override public IPacket deserialize(final byte[] data, final int offset, final int length) { final ByteBuffer bb = ByteBuffer.wrap(data, offset, length); this.icmpType = bb.get(); this.icmpCode = bb.get(); this.checksum = bb.getShort(); this.payload = new Data(); this.payload = this.payload.deserialize(data, bb.position(), bb.limit() - bb.position()); this.payload.setParent(this); return this; }
ICMP extends BasePacket { @Override public IPacket deserialize(final byte[] data, final int offset, final int length) { final ByteBuffer bb = ByteBuffer.wrap(data, offset, length); this.icmpType = bb.get(); this.icmpCode = bb.get(); this.checksum = bb.getShort(); this.payload = new Data(); this.payload = this.payload.deserialize(data, bb.position(), bb.limit() - bb.position()); this.payload.setParent(this); return this; } }
ICMP extends BasePacket { @Override public IPacket deserialize(final byte[] data, final int offset, final int length) { final ByteBuffer bb = ByteBuffer.wrap(data, offset, length); this.icmpType = bb.get(); this.icmpCode = bb.get(); this.checksum = bb.getShort(); this.payload = new Data(); this.payload = this.payload.deserialize(data, bb.position(), bb.limit() - bb.position()); this.payload.setParent(this); return this; }  }
ICMP extends BasePacket { @Override public IPacket deserialize(final byte[] data, final int offset, final int length) { final ByteBuffer bb = ByteBuffer.wrap(data, offset, length); this.icmpType = bb.get(); this.icmpCode = bb.get(); this.checksum = bb.getShort(); this.payload = new Data(); this.payload = this.payload.deserialize(data, bb.position(), bb.limit() - bb.position()); this.payload.setParent(this); return this; }  byte getIcmpType(); ICMP setIcmpType(final byte icmpType); byte getIcmpCode(); ICMP setIcmpCode(final byte icmpCode); short getChecksum(); ICMP setChecksum(final short checksum); @Override byte[] serialize(); @Override IPacket deserialize(final byte[] data, final int offset,
                               final int length); @Override int hashCode(); @Override boolean equals(final Object obj); static Deserializer<ICMP> deserializer(); @Override String toString(); }
ICMP extends BasePacket { @Override public IPacket deserialize(final byte[] data, final int offset, final int length) { final ByteBuffer bb = ByteBuffer.wrap(data, offset, length); this.icmpType = bb.get(); this.icmpCode = bb.get(); this.checksum = bb.getShort(); this.payload = new Data(); this.payload = this.payload.deserialize(data, bb.position(), bb.limit() - bb.position()); this.payload.setParent(this); return this; }  byte getIcmpType(); ICMP setIcmpType(final byte icmpType); byte getIcmpCode(); ICMP setIcmpCode(final byte icmpCode); short getChecksum(); ICMP setChecksum(final short checksum); @Override byte[] serialize(); @Override IPacket deserialize(final byte[] data, final int offset,
                               final int length); @Override int hashCode(); @Override boolean equals(final Object obj); static Deserializer<ICMP> deserializer(); @Override String toString(); static final byte TYPE_ECHO_REQUEST; static final byte TYPE_ECHO_REPLY; static final byte SUBTYPE_ECHO_REPLY; static final short ICMP_HEADER_LENGTH; }