private void writeObject(Object value, int index, DataOutput out,
      SerializationContext context) throws IOException {
    byte objectType = objectTypeArray[index];
    if (logger.isTraceEnabled(LogMarker.VERSIONED_OBJECT_LIST_VERBOSE)) {
      logger.trace(LogMarker.VERSIONED_OBJECT_LIST_VERBOSE, "writing object {} of type {}: {}",
          index, objectType, value);
    }
    out.writeByte(objectType);
    if (objectType == OBJECT && value instanceof byte[]) {
      if (serializeValues) {
        DataSerializer.writeByteArray((byte[]) value, out);
      } else {
        out.write((byte[]) value);
      }
    } else if (objectType == EXCEPTION) {
      // write exception as byte array so native clients can skip it
      DataSerializer.writeByteArray(CacheServerHelper.serialize(value), out);
      // write the exception string for native clients
      DataSerializer.writeString(value.toString(), out);
    } else {
      if (serializeValues) {
        DataSerializer.writeObjectAsByteArray(value, out);
      } else {
        context.getSerializer().writeObject(value, out);
      }
    }
  }
sets the keys for this partlist
geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/VersionedObjectList.java