public static byte[] serialize(Object obj, KnownVersion version) {
    if (obj == null || obj == Token.NOT_AVAILABLE || Token.isInvalidOrRemoved(obj)) {
      throw new IllegalArgumentException(
          String.format("Must not serialize %s in this context.",
              obj));
    }
    try {
      return BlobHelper.serializeToBlob(obj, version);
    } catch (IOException e) {
      throw new SerializationException(
          "An IOException was thrown while serializing.",
          e);
    }
  }
Serialize an object into a <code>byte[]</code>

@throws IllegalArgumentException If <code>obj</code> should not be serialized
geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java