code: private void readFieldDescriptors(ObjectStreamClass cDesc)
              throws ClassNotFoundException, IOException {
          short numFields = input.readShort();
          ObjectStreamField[] fields = new ObjectStreamField[numFields];
  
          // We set it now, but each element will be inserted in the array further
          // down
          cDesc.setLoadFields(fields);
  
          // Check ObjectOutputStream.writeFieldDescriptors
          for (short i = 0; i < numFields; i++) {
              char typecode = (char) input.readByte();
              String fieldName = input.readUTF();
              boolean isPrimType = ObjectStreamClass.isPrimitiveType(typecode);
              String classSig;
              if (isPrimType) {
                  classSig = String.valueOf(typecode);
              } else {
                  // The spec says it is a UTF, but experience shows they dump
                  // this String using writeObject (unlike the field name, which
                  // is saved with writeUTF).
                  // And if resolveObject is enabled, the classSig may be modified
                  // so that the original class descriptor cannot be read
                  // properly, so it is disabled.
                  boolean old = enableResolve;
                  try {
                      enableResolve = false;
                      classSig = (String) readObject();
                  } finally {
                      enableResolve = old;
                  }
              }
  
              classSig = formatClassSig(classSig);
              ObjectStreamField f = new ObjectStreamField(classSig, fieldName);
              fields[i] = f;
          }
      }
docs: Reads a collection of field descriptors (name, type name, etc) for the
  class descriptor {@code cDesc} (an {@code ObjectStreamClass})
  
  @param cDesc
  The class descriptor (an {@code ObjectStreamClass})
  for which to write field information
  
  @throws IOException
  If an IO exception happened when reading the field
  descriptors.
  @throws ClassNotFoundException
  If a class for one of the field types could not be found
  
  @see #readObject()