Exemplo n.º 1
0
        public async Task CloseOutputAsync()
        {
            MemoryStream ms = new MemoryStream();
            CborDataWriter writer = new CborDataWriter(ms);

            Assert.IsTrue(ms.CanRead);
            await writer.CloseAsync();
            Assert.IsFalse(ms.CanRead);

            ms = new MemoryStream();
            writer = new CborDataWriter(ms) { CloseOutput = false };

            Assert.IsTrue(ms.CanRead);
            await writer.CloseAsync();
            Assert.IsTrue(ms.CanRead);
        }