private void checkTypeIdSet() {
        if (typeId == null) {
            throw new RuntimeException("typeId has not been set so we don't know what the bytes are");
        }
    }
Only call this after you have finished writing to the output stream.
stroom-pipeline/src/main/java/stroom/pipeline/refdata/store/StagingValueOutputStream.java