Пример #1
0
        public static int ReadZInt32(Stream stream)
        {
            uint num = ProtocolParser.ReadUInt32(stream);

            return((int)(num >> 1 ^ num << 31 >> 31));
        }
Пример #2
0
        public static Key ReadKey(Stream stream)
        {
            uint num = ProtocolParser.ReadUInt32(stream);

            return(new Key(num >> 3, (Wire)(num & 7)));
        }
Пример #3
0
 public static Key ReadKey(byte firstByte, Stream stream)
 {
     return(firstByte < (byte)128 ? new Key((uint)firstByte >> 3, (Wire)((int)firstByte & 7)) : new Key((uint)((int)ProtocolParser.ReadUInt32(stream) << 4 | (int)firstByte >> 3 & 15), (Wire)((int)firstByte & 7)));
 }