public SessionDataMessage Deserialize(Omnix.Serialization.RocketPack.RocketPackReader r, int rank) { if (rank > 256) { throw new System.FormatException(); } // Read property count uint propertyCount = r.GetUInt32(); ulong p_sessionId = 0; bool p_isCompleted = false; System.Buffers.IMemoryOwner <byte> p_data = Omnix.Base.SimpleMemoryOwner <byte> .Empty; for (; propertyCount > 0; propertyCount--) { uint id = r.GetUInt32(); switch (id) { case 0: // SessionId { p_sessionId = r.GetUInt64(); break; } case 1: // IsCompleted { p_isCompleted = r.GetBoolean(); break; } case 2: // Data { p_data = r.GetRecyclableMemory(262144); break; } } } return(new SessionDataMessage(p_sessionId, p_isCompleted, p_data)); }