public void NonEmptyRead(byte[] data, int objectsCount) { var readTokenBytes = new List <byte>(); ReadOnlySpan <byte> buffer = data; for (var i = 0; i < objectsCount; i++) { using (var tokenBytes = MsgPackSpec.CopyToken(buffer)) { buffer = buffer.Slice(tokenBytes.Memory.Length); readTokenBytes.AddRange(tokenBytes.Memory.ToArray()); } } buffer.IsEmpty.ShouldBeTrue(); readTokenBytes.ShouldBe(data); }