public IBatchContainer GetBatchContainer(ref CachedMessage cachedMessage) { //Deserialize payload int readOffset = 0; ArraySegment <byte> payload = SegmentBuilder.ReadNextBytes(cachedMessage.Segment, ref readOffset); MemoryMessageData message = MemoryMessageData.Create(cachedMessage.StreamGuid, cachedMessage.StreamNamespace, new ArraySegment <byte>(payload.ToArray())); return(new MemoryBatchContainer <TSerializer>(message, this.serializer)); }
/// <inheritdoc /> public IBatchContainer GetBatchContainer(ref CachedMessage cachedMessage) { //Deserialize payload int readOffset = 0; ArraySegment <byte> payload = SegmentBuilder.ReadNextBytes(cachedMessage.Segment, ref readOffset); object payloadObject = this.serializer.Deserialize <object>(payload); return(new GeneratedBatchContainer(cachedMessage.StreamId, payloadObject, new EventSequenceTokenV2(cachedMessage.SequenceNumber))); }
public IBatchContainer GetBatchContainer(ref CachedMessage cachedMessage) { //Deserialize payload int readOffset = 0; ArraySegment <byte> payload = SegmentBuilder.ReadNextBytes(cachedMessage.Segment, ref readOffset); var stream = new BinaryTokenStreamReader(payload); object payloadObject = this.serializationManager.Deserialize(stream); return(new GeneratedBatchContainer(cachedMessage.StreamGuid, cachedMessage.StreamNamespace, payloadObject, new EventSequenceTokenV2(cachedMessage.SequenceNumber))); }
public IBatchContainer GetBatchContainer(ref CachedMessage cachedMessage) { //Deserialize payload int readOffset = 0; ArraySegment <byte> payload = SegmentBuilder.ReadNextBytes(cachedMessage.Segment, ref readOffset); return(new TestBatchContainer { StreamId = cachedMessage.StreamId, SequenceToken = GetSequenceToken(ref cachedMessage), Data = payload.ToArray() }); }