/** * Creates and returns an instance of CachedDeserializable that contains the * specified object (that is not a byte[]). */ public static CachedDeserializable create(Object object, int serializedSize) { if (STORE_ALL_VALUE_FORMS) { return new StoreAllCachedDeserializable(object); } else if (PREFER_DESERIALIZED) { if (object instanceof PdxInstance && cachePrefersPdx()) { return new PreferBytesCachedDeserializable(object); } else { return new VMCachedDeserializable(object, serializedSize); } } else { return new PreferBytesCachedDeserializable(object); } }
/** * Creates and returns an instance of CachedDeserializable that contains the * specified byte array. */ public static CachedDeserializable create(byte[] v) { if (STORE_ALL_VALUE_FORMS) { return new StoreAllCachedDeserializable(v); } else if (PREFER_DESERIALIZED) { if (isPdxEncoded(v) && cachePrefersPdx()) { return new PreferBytesCachedDeserializable(v); } else { return new VMCachedDeserializable(v); } } else { return new PreferBytesCachedDeserializable(v); } }
/** * Creates and returns an instance of CachedDeserializable that contains the * specified byte array. */ static CachedDeserializable createNoCheck(final byte[] v) { if (STORE_ALL_VALUE_FORMS) { return new StoreAllCachedDeserializable(v); } else if (PREFER_DESERIALIZED) { if (isPdxEncoded(v) && cachePrefersPdx()) { return new PreferBytesCachedDeserializable(v); } else { return new VMCachedDeserializable(v); } } else { return new PreferBytesCachedDeserializable(v); } }
/** * Creates and returns an instance of CachedDeserializable that contains the * specified object (that is not a byte[]). * * Always check for {@link #preferObject()} before invoking this. */ public static CachedDeserializable create(Object object, int serializedSize) { Assert.assertTrue(!PREFER_RAW_OBJECT, "should not be invoked for gemfire.PREFER_RAW_OBJECT"); if (STORE_ALL_VALUE_FORMS) { return new StoreAllCachedDeserializable(object); } else if (PREFER_DESERIALIZED) { if (object instanceof PdxInstance && cachePrefersPdx()) { return new PreferBytesCachedDeserializable(object); } else { return new VMCachedDeserializable(object, serializedSize); } } else { return new PreferBytesCachedDeserializable(object); } }