code: private Object readNonPrimitiveContent(boolean unshared)
              throws ClassNotFoundException, IOException {
          checkReadPrimitiveTypes();
          int remaining = primitiveData.available();
          if (remaining > 0) {
              OptionalDataException e = new OptionalDataException(remaining);
              e.length = remaining;
              throw e;
          }
  
          do {
              byte tc = nextTC();
              switch (tc) {
                  case TC_CLASS:
                      return readNewClass(unshared);
                  case TC_CLASSDESC:
                      return readNewClassDesc(unshared);
                  case TC_ARRAY:
                      return readNewArray(unshared);
                  case TC_OBJECT:
                      return readNewObject(unshared);
                  case TC_STRING:
                      return readNewString(unshared);
                  case TC_LONGSTRING:
                      return readNewLongString(unshared);
                  case TC_ENUM:
                      return readEnum(unshared);
                  case TC_REFERENCE:
                      if (unshared) {
                          readNewHandle();
                          throw new InvalidObjectException("Unshared read of back reference");
                      }
                      return readCyclicReference();
                  case TC_NULL:
                      return null;
                  case TC_EXCEPTION:
                      Exception exc = readException();
                      throw new WriteAbortedException("Read an exception", exc);
                  case TC_RESET:
                      resetState();
                      break;
                  case TC_ENDBLOCKDATA: // Can occur reading class annotation
                      pushbackTC();
                      OptionalDataException e = new OptionalDataException(true);
                      e.eof = true;
                      throw e;
                  default:
                      throw corruptStream(tc);
              }
              // Only TC_RESET falls through
          } while (true);
      }
docs: Reads the content of the receiver based on the previously read token
  {@code tc}. Primitive data content is considered an error.
  
  @param unshared
  read the object unshared
  @return the object read from the stream
  
  @throws IOException
  If an IO exception happened when reading the class
  descriptor.
  @throws ClassNotFoundException
  If the class corresponding to the object being read could not
  be found.