code: private void readFieldValues(EmulatedFieldsForLoading emulatedFields)
              throws OptionalDataException, InvalidClassException, IOException {
          EmulatedFields.ObjectSlot[] slots = emulatedFields.emulatedFields().slots();
          for (ObjectSlot element : slots) {
              element.defaulted = false;
              Class<?> type = element.field.getType();
              if (type == int.class) {
                  element.fieldValue = input.readInt();
              } else if (type == byte.class) {
                  element.fieldValue = input.readByte();
              } else if (type == char.class) {
                  element.fieldValue = input.readChar();
              } else if (type == short.class) {
                  element.fieldValue = input.readShort();
              } else if (type == boolean.class) {
                  element.fieldValue = input.readBoolean();
              } else if (type == long.class) {
                  element.fieldValue = input.readLong();
              } else if (type == float.class) {
                  element.fieldValue = input.readFloat();
              } else if (type == double.class) {
                  element.fieldValue = input.readDouble();
              } else {
                  // Either array or Object
                  try {
                      element.fieldValue = readObject();
                  } catch (ClassNotFoundException cnf) {
                      // WARNING- Not sure this is the right thing to do. Write
                      // test case.
                      throw new InvalidClassException(cnf.toString());
                  }
              }
          }
      }
docs: Reads a collection of field values for the emulated fields
  {@code emulatedFields}
  
  @param emulatedFields
  an {@code EmulatedFieldsForLoading}, concrete subclass
  of {@code GetField}
  
  @throws IOException
  If an IO exception happened when reading the field values.
  @throws InvalidClassException
  If an incompatible type is being assigned to an emulated
  field.
  @throws OptionalDataException
  If optional data could not be found when reading the
  exception graph
  
  @see #readFields
  @see #readObject()