public void Primitive()
        {
            using var sink = new ChunkedMemorySinkStream(ChunkSize);
            Assert.False(sink.CanRead);
            Assert.False(sink.CanSeek);
            Assert.False(sink.CanTimeout);
            Assert.True(sink.CanWrite);
            Assert.Equal(0, sink.Position);
            var data = new byte[ChunkSize / 2 + 1];

            sink.Write(data, 0, data.Length);
            sink.WriteAsync(data.AsMemory(), default).AsTask().Wait();
            sink.WriteAsync(data, 0, data.Length, default).Wait();
            Assert.Equal(data.Length * 3, sink.Length);
        }
        public void OneAndHalfChunkSize()
        {
            var data = new byte[ChunkSize * 3 / 2];

            FillRandom(data);
            using var sink = new ChunkedMemorySinkStream(ChunkSize);
            sink.Write(data);
            Assert.Equal(data.Length, sink.Position);
            Assert.False(sink.IsSingleChunk);
            Assert.False(sink.TryGetSingleChunk(out var chunk));
            using var accessor = sink.CloseAndCreateAccessor();
            Assert.True(SpanEquals(data, accessor.ToArray()));
            using var buffer = new MemoryStream();
            accessor.CopyTo(buffer);
            Assert.True(SpanEquals(data, buffer.ToArray()));
        }