Пример #1
0
        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));
        }
Пример #2
0
        /// <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)));
        }
Пример #3
0
        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)));
        }
Пример #4
0
            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()
                });
            }