Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpbcgr.Virtual_Channel_Complete_Server_Pdu.ToBytes C# (CSharp) Method

ToBytes() public method

public ToBytes ( ) : byte[]
return byte[]
        public override byte[] ToBytes()
        {
            List<byte> totalBuffer = new List<byte>();
            RdpbcgrEncoder.EncodeStructure(totalBuffer, channelId);
            RdpbcgrEncoder.EncodeBytes(totalBuffer, virtualChannelData);

            for (int i = 0; i < rawPdus.Count; i++)
            {
                List<byte> channelBuffer = new List<byte>();
                RdpbcgrEncoder.EncodeStructure(channelBuffer, rawPdus[i].channelPduHeader);
                RdpbcgrEncoder.EncodeBytes(channelBuffer, rawPdus[i].virtualChannelData);
                RdpbcgrEncoder.EncodeSlowPathPdu(
                    totalBuffer,
                    rawPdus[i].commonHeader,
                    channelBuffer.ToArray(),
                    serverSessionContext);
            }

            return RdpbcgrUtility.ToBytes(totalBuffer);
        }