Beispiel #1
0
        public ResizeBufReader ToReader()
        {
            lock (_writeLock)
            {
                if (_handle == null)
                {
                    throw new InvalidOperationException("ResizeBuf is not writable");
                }

                var reader = new ResizeBufReader(_handle);
                _handle = null;

                return(reader);
            }
        }
        public void Read_Empty()
        {
            var reader = new ResizeBufReader();

            Assert.Equal(Span <byte> .Empty.ToArray(), reader.Slice().ToArray());
        }