예제 #1
0
        public async Task WriteToPipeWriter()
        {
            var blist = new BList {
                1, 2, "abc"
            };

            var(reader, writer) = new Pipe();

            blist.EncodeTo(writer);
            await writer.FlushAsync();

            reader.TryRead(out var readResult);

            var result = Encoding.UTF8.GetString(readResult.Buffer.First.Span.ToArray());

            result.Should().Be("li1ei2e3:abce");
        }