public static PyCachedObject FromCacheHint(PyCacheHint cacheInfo, byte[] data) { PyCachedObject cachedObject = new PyCachedObject(); cachedObject.NodeID = cacheInfo.NodeID; cachedObject.ObjectID = cacheInfo.ObjectID; cachedObject.Shared = 1; cachedObject.Compressed = 1; cachedObject.Cache = new PyBuffer(ZlibHelper.Compress(data)); cachedObject.Timestamp = cacheInfo.CacheTime; cachedObject.Version = cacheInfo.Version; return(cachedObject); }
public static PyCachedObject FromCacheHint(PyCacheHint cacheInfo, PyDataType data) { PyCachedObject cachedObject = new PyCachedObject(); cachedObject.NodeID = cacheInfo.NodeID; cachedObject.ObjectID = cacheInfo.ObjectID; cachedObject.Shared = 1; cachedObject.Compressed = 1; cachedObject.Cache = new PyBuffer(ZlibHelper.Compress(PythonTypes.Marshal.Marshal.ToByteArray(data))); cachedObject.Timestamp = cacheInfo.CacheTime; cachedObject.Version = cacheInfo.Version; return(cachedObject); }