public ByteBuffer getValueBuffer() {
        if (valueBuffer == null) {
            getFullByteBuffer();
        }
        return valueBuffer;
    }
Only call this after you have finished writing to the output stream.
stroom-pipeline/src/main/java/stroom/pipeline/refdata/store/StagingValueOutputStream.java