Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpedyc.DataDvcBasePdu.NonDataSize C# (CSharp) Méthode

NonDataSize() public méthode

Compute the Non Data size.
public NonDataSize ( bool isSp ) : int
isSp bool Indicates the 4-5 bits are Sp or Len
Résultat int
        public int NonDataSize(bool isSp)
        {
            // Header length = 1;
            int len = 1;

            // cbChId indicates the length of the ChannelId field.
            switch (this.HeaderBits.CbChannelId)
            {
                case cbChId_Values.OneByte:
                    len += 1;
                    break;
                case cbChId_Values.TwoBytes:
                    len += 2;
                    break;
                case cbChId_Values.FourBytes:
                    len += 4;
                    break;
                case cbChId_Values.Invalid:
                default:
                    DynamicVCException.Throw("channelIdSize is invalid.");
                    break;
            }

            if(!isSp)
            {
                // If the 4-5 bit is Len, this value indicates the Length of Length field.
                // DYNVC_DATA_FIRST and DYNVC_DATA_FIRST_COMPRESSED have Length field.
                switch ((Len_Values)this.HeaderBits.Sp)
                {
                    case Len_Values.OneByte:
                        len += 1;
                        break;
                    case Len_Values.TwoBytes:
                        len += 2;
                        break;
                    case Len_Values.FourBytes:
                        len += 4;
                        break;
                    case Len_Values.Invalid:
                    default:
                        DynamicVCException.Throw("lengthSize is invalid.");
                        break;
                }
            }

            return len;
        }
DataDvcBasePdu