Beispiel #1
0
        public override int ReadFromBytes(byte[] bBytes, int nAt)
        {
            if (bBytes.Length < (nAt + 2))
            {
                return(0);
            }

            m_bVersion = bBytes[nAt];
            SockMethod = (SockMethod)bBytes[nAt + 1];

            return(2);
        }
Beispiel #2
0
        public override int ReadFromBytes(byte[] bBytes, int nAt)
        {
            if (bBytes.Length < (nAt + 2))
            {
                return(0);
            }

            m_bVersion = bBytes[nAt];
            byte nLength = bBytes[nAt + 1];

            if (bBytes.Length < (nAt + 2 + nLength))
            {
                return(0);
            }

            Methods.Clear();
            for (int i = 0; i < nLength; i++)
            {
                SockMethod method = (SockMethod)bBytes[nAt + i + 2];
                Methods.Add(method);
            }

            return(2 + nLength);
        }