@Test public void testDeserialize() throws Exception { RouterSolicitation rs = deserializer.deserialize(bytePacket, 0, bytePacket.length); assertThat(rs.getOptions().size(), is(1)); NeighborDiscoveryOptions.Option option = rs.getOptions().get(0); assertThat(option.type(), is(NeighborDiscoveryOptions.TYPE_TARGET_LL_ADDRESS)); assertArrayEquals(option.data(), MAC_ADDRESS1.toBytes()); }
@Override public IPacket deserialize(byte[] data, int offset, int length) { final ByteBuffer bb = ByteBuffer.wrap(data, offset, length); bb.getInt(); this.options.deserialize(data, bb.position(), bb.limit() - bb.position()); return this; }
RouterSolicitation extends BasePacket { @Override public IPacket deserialize(byte[] data, int offset, int length) { final ByteBuffer bb = ByteBuffer.wrap(data, offset, length); bb.getInt(); this.options.deserialize(data, bb.position(), bb.limit() - bb.position()); return this; } }
RouterSolicitation extends BasePacket { @Override public IPacket deserialize(byte[] data, int offset, int length) { final ByteBuffer bb = ByteBuffer.wrap(data, offset, length); bb.getInt(); this.options.deserialize(data, bb.position(), bb.limit() - bb.position()); return this; }  }
RouterSolicitation extends BasePacket { @Override public IPacket deserialize(byte[] data, int offset, int length) { final ByteBuffer bb = ByteBuffer.wrap(data, offset, length); bb.getInt(); this.options.deserialize(data, bb.position(), bb.limit() - bb.position()); return this; }  List<NeighborDiscoveryOptions.Option> getOptions(); RouterSolicitation addOption(final byte type, final byte[] data); @Override byte[] serialize(); @Override IPacket deserialize(byte[] data, int offset, int length); @Override int hashCode(); @Override boolean equals(final Object obj); static Deserializer<RouterSolicitation> deserializer(); @Override String toString(); }
RouterSolicitation extends BasePacket { @Override public IPacket deserialize(byte[] data, int offset, int length) { final ByteBuffer bb = ByteBuffer.wrap(data, offset, length); bb.getInt(); this.options.deserialize(data, bb.position(), bb.limit() - bb.position()); return this; }  List<NeighborDiscoveryOptions.Option> getOptions(); RouterSolicitation addOption(final byte type, final byte[] data); @Override byte[] serialize(); @Override IPacket deserialize(byte[] data, int offset, int length); @Override int hashCode(); @Override boolean equals(final Object obj); static Deserializer<RouterSolicitation> deserializer(); @Override String toString(); static final byte HEADER_LENGTH; }