public KzSequenceSegment <T> Append(KzSequenceSegment <T> nextSegment)
 {
     Trace.Assert(nextSegment.RunningIndex == 0);
     Next = nextSegment;
     nextSegment.RunningIndex = RunningIndex + nextSegment.Memory.Length;
     return(nextSegment);
 }
        public KzSequenceSegment <T> Append(ReadOnlyMemory <T> memory)
        {
            var segment = new KzSequenceSegment <T>(memory)
            {
                RunningIndex = RunningIndex + Memory.Length
            };

            Next = segment;
            return(segment);
        }
 public KzSequenceSegment(ReadOnlyMemory <T> memory, KzSequenceSegment <T> prev = null)
 {
     Memory = memory;
 }