Microsoft.Protocols.TestSuites.MS_OXCFXICS.FastTransferStream.ReadUInt8 C# (CSharp) Method

ReadUInt8() public method

Read a byte value from stream, and advance the position.
public ReadUInt8 ( ) : byte
return byte
        public byte ReadUInt8()
        {
            byte result = 0;
            int tmp = ReadByte();
            if (tmp == -1)
            {
                AdapterHelper.Site.Assert.Fail("The end of the stream has been reached.");
            }
            else if (tmp >= 0)
            {
                result = (byte)tmp;
            }
            else
            {
                AdapterHelper.Site.Assert.Fail(string.Format("Expecting to get an unsigned integer from the stream, but the actual value is {0}.", tmp));
            }

            return result;
        }