public static void invokeFromData(Object deserializableObject, DataInput in)
      throws IOException, ClassNotFoundException {
    if (deserializableObject instanceof BasicSerializable) {
      dsfidSerializer.invokeFromData(deserializableObject, in);
      return;
    }
    try {
      boolean invoked = false;
      KnownVersion v = StaticSerialization.getVersionForDataStreamOrNull(in);
      if (KnownVersion.CURRENT != v && v != null) {
        // get versions where DataOutput was upgraded
        KnownVersion[] versions = null;
        if (deserializableObject instanceof SerializationVersions) {
          SerializationVersions vds = (SerializationVersions) deserializableObject;
          versions = vds.getSerializationVersions();
        }
        // check if the version of the peer or diskstore is different and
        // there has been a change in the message
        if (versions != null) {
          for (KnownVersion version : versions) {
            // if peer version is less than the greatest upgraded version
            if (v.compareTo(version) < 0) {
              deserializableObject.getClass()
                  .getMethod("fromDataPre" + '_' + version.getMethodSuffix(),
                      new Class[] {DataInput.class})
                  .invoke(deserializableObject, in);
              invoked = true;
              break;
            }
          }
        }
      }
      if (!invoked) {
        ((DataSerializable) deserializableObject).fromData(in);

        if (logger.isTraceEnabled(LogMarker.SERIALIZER_VERBOSE)) {
          logger.trace(LogMarker.SERIALIZER_VERBOSE, "Read DataSerializable {}",
              deserializableObject);
        }
      }
    } catch (EOFException | ClassNotFoundException | CacheClosedException | SocketException ex) {
      // client went away - ignore
      throw ex;
    } catch (Exception ex) {
      throw new SerializationException(
          String.format("Could not create an instance of %s .",
              deserializableObject.getClass().getName()),
          ex);
    }
  }
For backward compatibility this method should be used to invoke fromData on a DSFID or
DataSerializable. It will invoke the correct fromData method based on the class's version
information. This method does not read information about the class of the object. When
serializing use the method invokeToData to write the contents of the object.

@param deserializableObject the object to write
@param in the input stream.
geode-core/src/main/java/org/apache/geode/internal/InternalDataSerializer.java