<IO> KnownVersion getVersionForDataStream(final IO in) {
    // check if this is a versioned data input
    if (in instanceof VersionedDataStream) {
      final KnownVersion v = ((VersionedDataStream) in).getVersion();
      return v != null ? v : KnownVersion.getCurrentVersion();
    } else {
      // assume latest version
      return KnownVersion.getCurrentVersion();
    }
  }
Both Serialization and Deserialization contexts implement this interface to allow
a toData or fromData method to determine the Geode Version of the data stream.
geode-serialization/src/main/java/org/apache/geode/internal/serialization/internal/AbstractSerializationContext.java