*/
    private void writeObjectValue(Reference ref, Object obj) throws IOException {
        logger.log(Level.FINER, "writeObjectValue()  obj: {0}", obj);
        if (ref == null)
            throw new IllegalArgumentException("Reference must be non-null for object: " + obj);
        if (obj == null)
            throw new IllegalArgumentException("Object must be non-null");
        addEntry( new Entry(ref, startingPosition + output.getCount()) );

        writeInteger(ref.getObjectNumber());
        output.write(SPACE);
        writeInteger(ref.getGenerationNumber());
        output.write(SPACE);
        output.write(BEGIN_OBJECT);
        writeValue(obj);
        output.write(END_OBJECT);
    }