/// <summary> /// Invokes the receiver. /// </summary> /// <param name="receiver">Receiver.</param> /// <param name="grid">Grid.</param> /// <param name="cache">Cache.</param> /// <param name="stream">Stream.</param> /// <param name="keepBinary">Binary flag.</param> public static void InvokeReceiver <TK, TV>(IStreamReceiver <TK, TV> receiver, Ignite grid, IUnmanagedTarget cache, IBinaryStream stream, bool keepBinary) { var reader = grid.Marshaller.StartUnmarshal(stream, keepBinary); var size = reader.ReadInt(); var entries = new List <ICacheEntry <TK, TV> >(size); for (var i = 0; i < size; i++) { entries.Add(new CacheEntry <TK, TV>(reader.ReadObject <TK>(), reader.ReadObject <TV>())); } receiver.Receive(grid.Cache <TK, TV>(cache, keepBinary), entries); }