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);
}