@Override
    public ByteBuffer serialize(final PooledByteBufferOutputStream pooledByteBufferOutputStream,
                                final StagingRefDataValue stagingRefDataValue) {
        final RefDataValue refDataValue = stagingRefDataValue.getRefDataValue();

        try {
            pooledByteBufferOutputStream.write(stagingRefDataValue.getTypeId());
            pooledByteBufferOutputStream.write(Bytes.toBytes(refDataValue.getValueHashCode(valueStoreHashAlgorithm)));
            final ByteBuffer refDataValueBuffer = genericRefDataValueSerde.serialize(
                    pooledByteBufferOutputStream, refDataValue);

            pooledByteBufferOutputStream.write(refDataValueBuffer);
            return pooledByteBufferOutputStream.getByteBuffer();
        } catch (IOException e) {
            throw new RuntimeException(LogUtil.message("Unable to write value {} to output stream: {}",
                    stagingRefDataValue, e.getMessage()), e);
        }
    }
<pre>{@code
<type ID int><hash code long><value bytes................>
}</pre>
stroom-pipeline/src/main/java/stroom/pipeline/refdata/store/offheapstore/serdes/StagingRefDataValueSerde.java