Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpbcgr.RdpbcgrDecoder.ParseTsUdScNet C# (CSharp) Method

ParseTsUdScNet() private method

Parse TS_UD_SC_NET (parser index is updated according to parsed length)
private ParseTsUdScNet ( byte data, int &currentIndex ) : TS_UD_SC_NET
data byte data to be parsed
currentIndex int current parser index
return TS_UD_SC_NET
        private TS_UD_SC_NET ParseTsUdScNet(byte[] data, ref int currentIndex)
        {
            TS_UD_SC_NET netData = new TS_UD_SC_NET();

            // reserve current index
            int reservedIndex = currentIndex;

            // TS_UD_SC_NET: Header
            netData.header.type = (TS_UD_HEADER_type_Values)ParseUInt16(data, ref currentIndex, false);
            netData.header.length = ParseUInt16(data, ref currentIndex, false);

            // TS_UD_SC_NET: MCSChannelID
            netData.MCSChannelId = ParseUInt16(data, ref currentIndex, false);

            // TS_UD_SC_NET: channelCount
            netData.channelCount = ParseUInt16(data, ref currentIndex, false);

            // TS_UD_SC_NET: channelIdArray
            netData.channelIdArray = new ushort[netData.channelCount];
            for (int i = 0; i < netData.channelIdArray.Length; i++)
            {
                netData.channelIdArray[i] = ParseUInt16(data, ref currentIndex, false);
            }

            // TS_UD_SC_NET: Pad
            // (the even/odd checking option described in TD is granted to adapter,
            // thus adpter can verify their consistency)
            int remainDataLength = netData.header.length - (currentIndex - reservedIndex);
            netData.Pad = GetBytes(data, ref currentIndex, remainDataLength);

            return netData;
        }
RdpbcgrDecoder