class ByteBufDataType extends BasicDataType<ByteBuf> {

    @Override
    public int compare(ByteBuf a, ByteBuf b) {
        throw DataUtils.newUnsupportedOperationException("Can not compare");
    }

    @Override
    public int getMemory(ByteBuf obj) {
        if (!(obj instanceof ByteBuf)) {
            throw new IllegalArgumentException("Expected instance of ByteBuf but found " + obj.getClass());
        }
        final int payloadSize = ((ByteBuf) obj).readableBytes();
        return 4 + payloadSize;
    }

    @Override
    public ByteBuf read(ByteBuffer buff) {<FILL_FUNCTION_BODY>}

    @Override
    public void write(WriteBuffer buff, ByteBuf obj) {
        final int payloadSize = obj.readableBytes();
        byte[] rawBytes = new byte[payloadSize];
        obj.copy().readBytes(rawBytes).release();
        buff.putInt(payloadSize);
        buff.put(rawBytes);
    }

    @Override
    public ByteBuf[] createStorage(int i) {
        return new ByteBuf[i];
    }

}

        final int payloadSize = buff.getInt();
        byte[] payload = new byte[payloadSize];
        buff.get(payload);
        return Unpooled.wrappedBuffer(payload);
    
<no_super_class>