class ICMP6 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();

        Deserializer<? extends IPacket> deserializer;
        if (ICMP6.TYPE_DESERIALIZER_MAP.containsKey(icmpType)) {
            deserializer = TYPE_DESERIALIZER_MAP.get(icmpType);
        } else {
            deserializer = Data.deserializer();
        }
        try {
            this.payload = deserializer.deserialize(data, bb.position(),
                                                     bb.limit() - bb.position());
            this.payload.setParent(this);
        } catch (DeserializationException e) {
            return this;
        }

        return this;
    }

}