Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpbcgr.RdpbcgrServerDecoder.ParseByte C# (CSharp) Method

ParseByte() private method

Parse one byte (parser index will be updated by one)
private ParseByte ( byte data, int &index ) : byte
data byte data to be parsed
index int parser index
return byte
        private byte ParseByte(byte[] data, ref int index)
        {
            // if input data is null
            if (null == data)
            {
                throw new FormatException(ConstValue.ERROR_MESSAGE_DATA_NULL_REF);
            }

            // if index is out of range
            if (index < 0 || index >= data.Length)
            {
                throw new FormatException(ConstValue.ERROR_MESSAGE_DATA_INDEX_OUT_OF_RANGE);
            }

            // get a byte
            byte b = data[index];

            // update parser index
            ++index;

            return b;
        }
RdpbcgrServerDecoder