SharpCifs.Smb.SmbTransport.PeekKey C# (CSharp) Méthode

PeekKey() protected méthode

protected PeekKey ( ) : ServerMessageBlock
Résultat ServerMessageBlock
        protected internal override ServerMessageBlock PeekKey()
        {
            int n;
            do
            {
                if ((n = Readn(In, Sbuf, 0, 4)) < 4)
                {
                    return null;
                }
            }
            while (Sbuf[0] == 0x85);
            if ((n = Readn(In, Sbuf, 4, 32)) < 32)
            {
                return null;
            }
            if (Log.Level >= 4)
            {
                Log.WriteLine("New data read: " + this);
                Hexdump.ToHexdump(Log, Sbuf, 4, 32);
            }
            for (; ; )
            {
                if (Sbuf[0] == 0x00 && Sbuf[1] == 0x00 &&
                    Sbuf[4] == 0xFF &&
                    Sbuf[5] == 'S' &&
                    Sbuf[6] == 'M' &&
                    Sbuf[7] == 'B')
                {
                    break;
                }
                for (int i = 0; i < 35; i++)
                {
                    Sbuf[i] = Sbuf[i + 1];
                }
                int b;
                if ((b = In.Read()) == -1)
                {
                    return null;
                }
                Sbuf[35] = unchecked((byte)b);
            }
            Key.Mid = Encdec.Dec_uint16le(Sbuf, 34) & 0xFFFF;
            return Key;
        }