public CycConstant readCompleteConstant()
          throws IOException {
    CycConstant cycConstant = null;
    Object idObject = readObject();

    if (idObject instanceof Guid) {
      final Guid guid = (Guid) idObject;
      final String name = (String) readObject();
      cycConstant = CycObjectFactory.getCycConstantCacheByGuid(guid);
      if (cycConstant == null) {
        cycConstant = new CycConstant(name, guid);
        CycObjectFactory.addCycConstantCache(cycConstant);
      }
    } else if ((idObject instanceof CycSymbol)
            && (idObject.equals(CycObjectFactory.makeCycSymbol(":FREE")))) {
      cycConstant = CycObjectFactory.FREE_CONSTANT;
    } else {
      // ignore the name, which is expected to be blank
      readObject();
      cycConstant = CycObjectFactory.INVALID_CONSTANT;
      isInvalidObject = true;
    }

    if (trace == API_TRACE_DETAILED) {
      debugNote("readConstant: " + cycConstant.toString());
    }

    return cycConstant;
  }