@Override
  public void invokeFromData(Object ds, DataInput in)
      throws IOException, ClassNotFoundException {
    DeserializationContextImpl context = new DeserializationContextImpl(in, this);
    try {
      boolean invoked = false;
      KnownVersion v = context.getSerializationVersion();
      if (!KnownVersion.CURRENT.equals(v) && ds instanceof SerializationVersions) {
        // get versions where DataOutput was upgraded
        SerializationVersions vds = (SerializationVersions) ds;
        KnownVersion[] 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) {
              ds.getClass().getMethod("fromDataPre" + '_' + version.getMethodSuffix(),
                  new Class[] {DataInput.class, DeserializationContext.class})
                  .invoke(ds, in, context);
              invoked = true;
              break;
            }
          }
        }
      }
      if (!invoked) {
        if (ds instanceof BasicSerializable) {
          ((BasicSerializable) ds).fromData(in, context);
        } else {
          throw new IOException(
              "problem invoking fromData method on object of class" + ds.getClass().getName());
        }
      }
    } catch (EOFException | ClassNotFoundException | SocketException ex) {
      // client went away - ignore
      throw ex;
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception ex) {
      throw new IOException(
          String.format("Could not create an instance of %s .",
              ds.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 ds the object to write
@param in the input stream.
geode-serialization/src/main/java/org/apache/geode/internal/serialization/internal/DSFIDSerializerImpl.java