ServiceStack.Text.RecyclableMemoryStream.ReadByte C# (CSharp) Method

ReadByte() public method

Reads a single byte from the current position in the stream.
Object has been disposed
public ReadByte ( ) : int
return int
        public override int ReadByte()
        {
            this.CheckDisposed();
            if (this.position == this.length)
            {
                return -1;
            }
            byte value = 0;
            if (this.largeBuffer == null)
            {
                var blockAndOffset = this.GetBlockAndRelativeOffset(this.position);
                value = this.blocks[blockAndOffset.Block][blockAndOffset.Offset];
            }
            else
            {
                value = this.largeBuffer[position];
            }
            this.position++;
            return value;
        }