private void writeReference(Reference ref) throws IOException {
        writeInteger(ref.getObjectNumber());
        output.write(SPACE);
        writeInteger(ref.getGenerationNumber());
        output.write(SPACE);
        output.write(REFERENCE);
    }