code: private ObjectStreamClass readNewClassDesc(boolean unshared)
              throws ClassNotFoundException, IOException {
          // So read...() methods can be used by
          // subclasses during readClassDescriptor()
          primitiveData = input;
          int oldHandle = descriptorHandle;
          descriptorHandle = nextHandle();
          ObjectStreamClass newClassDesc = readClassDescriptor();
          registerObjectRead(newClassDesc, descriptorHandle, unshared);
          descriptorHandle = oldHandle;
          primitiveData = emptyStream;
  
          // We need to map classDesc to class.
          try {
              newClassDesc.setClass(resolveClass(newClassDesc));
              // Check SUIDs & base name of the class
              verifyAndInit(newClassDesc);
          } catch (ClassNotFoundException e) {
              if (mustResolve) {
                  throw e;
                  // Just continue, the class may not be required
              }
          }
  
          // Resolve the field signatures using the class loader of the
          // resolved class
          ObjectStreamField[] fields = newClassDesc.getLoadFields();
          fields = (fields == null) ? ObjectStreamClass.NO_FIELDS : fields;
          ClassLoader loader = newClassDesc.forClass() == null ? callerClassLoader
                  : newClassDesc.forClass().getClassLoader();
          for (ObjectStreamField element : fields) {
              element.resolve(loader);
          }
  
          // Consume unread class annotation data and TC_ENDBLOCKDATA
          discardData();
          checkedSetSuperClassDesc(newClassDesc, readClassDesc());
          return newClassDesc;
      }
docs: Reads a new class descriptor from the receiver. It is assumed the class
  descriptor has not been read yet (not a cyclic reference). Return the
  class descriptor read.
  
  @param unshared
  read the object unshared
  @return The {@code ObjectStreamClass} read from the stream.
  
  @throws IOException
  If an IO exception happened when reading the class
  descriptor.
  @throws ClassNotFoundException
  If a class for one of the objects could not be found