當前位置: 首頁>>代碼示例>>C#>>正文


C# ByteBuffer.Get方法代碼示例

本文整理匯總了C#中System.ByteBuffer.Get方法的典型用法代碼示例。如果您正苦於以下問題:C# ByteBuffer.Get方法的具體用法?C# ByteBuffer.Get怎麽用?C# ByteBuffer.Get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.ByteBuffer的用法示例。


在下文中一共展示了ByteBuffer.Get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Read

 public void Read(ByteBuffer buf)
 {
     Id = (uint)buf.Get();
     Path = buf.GetUInt();
     int len = (int)buf.Get();
     Name = Utils.Util.GetString(buf.GetByteArray(len));
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:7,代碼來源:QQOrganization.cs

示例2: Read

 /// <summary>
 /// </summary>
 /// <param name="buf">The buf.</param>
 public void Read(ByteBuffer buf)
 {
     // 發送者
     Sender = buf.GetInt();
     // 未知的4字節
     buf.GetInt();
     // 昵稱
     int len = buf.Get() & 0xFF;
     Nick = Utils.Util.GetString(buf, len);
     // 群名稱
     len = buf.Get() & 0xFF;
     Site = Utils.Util.GetString(buf, len);
     // 未知的1字節
     buf.Get();
     // 時間
     Time = (long)buf.GetInt() * 1000L;
     // 後麵的內容長度
     len = buf.GetUShort();
     // 得到字體屬性長度,然後得到消息內容
     int fontStyleLength = buf.Get(buf.Position + len - 1) & 0xFF;
     Message = Utils.Util.GetString(buf, len - fontStyleLength);
     // 字體屬性
     FontStyle = new FontStyle();
     FontStyle.Read(buf);
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:28,代碼來源:TempSessionIM.cs

示例3: Read

        public void Read( ByteBuffer buf)
        {
            while (buf.HasRemaining())
               {
               byte type = buf.Get();
               int len = buf.GetUShort();
               switch (type)
               {
                   case 0x01:
                       FaceId = buf.Get();
                       break;
                   case 0xff:
                       FFData = buf.GetByteArray(len);
                       break;
                   default:
                       QQClient.LogManager.Log(base.ToString()+" Parse Error,Unknown Type=" + type.ToString("X") + ": Data=" + Utils.Util.ToHex(buf.GetByteArray(len)));
                       break;

               }
               }
               if (buf.HasRemaining())
               {
               RemainBytes = buf.GetByteArray(buf.Remaining());
               QQClient.LogManager.Log(base.ToString() + " Class Parse Buf Remaining Data:" + Utils.Util.ToHex(RemainBytes));
               }
        }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:26,代碼來源:NormalIMFace.cs

示例4: ParseBody

 protected override void ParseBody(ByteBuffer buf)
 {
     buf.Get();
     ReplyCode = (ReplyCode)buf.Get();
     buf.Get();
     Onlines = new List<uint>();
     while (buf.HasRemaining())
         Onlines.Add(buf.GetUInt());
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:9,代碼來源:GetTempClusterOnlineMemberReplyPacket.cs

示例5: ParseBody

 protected override void ParseBody(ByteBuffer buf)
 {
     ReplyCode = (ReplyCode)buf.Get();
     if (ReplyCode == ReplyCode.OK)
     {
         int len = buf.Get() & 0xFF;
         LoginToken = buf.GetByteArray(len);
     }
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:9,代碼來源:RequestLoginTokenReplyPacket.cs

示例6: ParseBody

 protected override void ParseBody(ByteBuffer buf)
 {
     #if DEBUG
     Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
     #endif
     ReplyCode = (ReplyCode)buf.Get();
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:7,代碼來源:UploadGroupFriendReplyPacket.cs

示例7: Read

 public void Read(ByteBuffer buf)
 {
     QQ = buf.GetInt();
     ModifiedTime = buf.GetInt();
     int len = buf.Get() & 0xFF;
     Sig = Utils.Util.GetString(buf, len);
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:7,代碼來源:Signature.cs

示例8: Read

 /// <summary>
 /// </summary>
 /// <param name="buf">The buf.</param>
 public void Read(ByteBuffer buf)
 {
     ByteBuffer temp = new ByteBuffer();
     int i = 0;
     while (true)
     {
         byte b = buf.Get();
         if (b != 0x1F)
         {
             if (b != 0x1E)
             {
                 temp.Put(b);
             }
             else
             {
                 if (i == 0)
                 {
                     QQ = Utils.Util.GetInt(Utils.Util.GetString(temp.ToByteArray()), 0000);
                 }
                 else if (i == 1)
                     Nick = Utils.Util.GetString(temp.ToByteArray());
                 else if (i == 2)
                     Province = Utils.Util.GetString(temp.ToByteArray());
                 i++;
                 temp.Initialize();
             }
         }
         else
         {
             Face = Utils.Util.GetInt(Utils.Util.GetString(temp.ToByteArray()), 0);
             break;
         }
     }
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:37,代碼來源:UserInfo.cs

示例9: ByteBuffer_GetByteReturnsCorrectData

 public void ByteBuffer_GetByteReturnsCorrectData()
 {
     var buffer = new byte[1];
     buffer[0] = 99;
     var uut = new ByteBuffer(buffer);
     Assert.AreEqual((byte)99, uut.Get(0));
 }
開發者ID:google,項目名稱:flatbuffers,代碼行數:7,代碼來源:ByteBufferTests.cs

示例10: Read

 public void Read(ByteBuffer buf)
 {
     //振動 00 00 00 01 00 09 41 A1 34 00 00 00 00
        //輸入 00 00 00 01
        buf.GetInt();// 00 00 00 01
        if (buf.HasRemaining())
        {
        //long l=buf.GetLong();
        buf.Get();//0
      int qq=  buf.GetInt(); //QQ號碼
        buf.GetByteArray(3);//未知 00 00 00
      //byte[] data=  buf.GetByteArray(8);
      //byte[] comparedata = new byte[] { 0x00, 0x09, 0x41, 0xA1, 0x34, 0x00, 0x00, 0x00 };
      //long l = BitConverter.ToInt64(data, 0);
      //long l2 = BitConverter.ToInt64(comparedata, 0);
      //  if (l == l2)
      //  {
            IsShake = true;
        //}
        }
        else
        {
        IsInputState = true;
        }
 }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:25,代碼來源:Vibration.cs

示例11: ReadBindUserSMS

        /// <summary>給定一個輸入流,解析SMS結構
        /// </summary>
        /// <param name="buf">The buf.</param>
        public void ReadBindUserSMS(ByteBuffer buf)
        {
            // 未知1字節,0x0
            buf.Get();
            // 發送者QQ號,4字節
            Sender = buf.GetInt();
            // 發送者頭像
            Header = (int)buf.GetUShort();
            // 發送者名稱,最多13字節,不足後麵補0
            SenderName = Utils.Util.GetString(buf, (byte)0, QQGlobal.QQ_MAX_SMS_SENDER_NAME);
            // 未知的1字節,0x4D
            buf.Get();
            // 消息內容
            Message = Utils.Util.GetString(buf, (byte)0);

            Time = DateTime.Now.Millisecond;
        }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:20,代碼來源:SMS.cs

示例12: absGet

 private static void absGet(ByteBuffer b)
 {
     int n = b.Capacity;
     byte v;
     for (int i = 0; i < n; i++)
         ck(b, (long)b.Get(), (long)((byte)Ic(i)));
     b.Rewind();
 }
開發者ID:ChristopherHaws,項目名稱:lucenenet,代碼行數:8,代碼來源:TestByteBuffer.cs

示例13: relGet

 private static void relGet(ByteBuffer b, int start)
 {
     int n = b.Remaining;
     byte v;
     for (int i = start; i < n; i++)
         ck(b, (long)b.Get(), (long)((byte)Ic(i)));
     b.Rewind();
 }
開發者ID:ChristopherHaws,項目名稱:lucenenet,代碼行數:8,代碼來源:TestByteBuffer.cs

示例14: bulkGet

 private static void bulkGet(ByteBuffer b)
 {
     int n = b.Capacity;
     byte[] a = new byte[n + 7];
     b.Get(a, 7, n);
     for (int i = 0; i < n; i++)
         ck(b, (long)a[i + 7], (long)((byte)Ic(i)));
 }
開發者ID:ChristopherHaws,項目名稱:lucenenet,代碼行數:8,代碼來源:TestByteBuffer.cs

示例15: ParseBody

        protected override void ParseBody(ByteBuffer buf)
        {
            #if DEBUG
            Client.LogManager.Log(ToString() + " Decoded Data:" + Utils.Util.ToHex(buf.ToByteArray()));
            #endif

            buf.GetChar();//length or sth..
            ReplyCode = buf.Get();
            int len = 0;
            switch (ReplyCode)
            {
                case 0x00://success!
                    Client.LogManager.Log(ToString() + ":0x" + ReplyCode.ToString("X2") + " Login Success!");
                    len = buf.GetChar();//0x0020
                    Client.QQUser.QQKey.LoginInfo_Token = buf.GetByteArray(len);
                    Client.QQUser.QQKey.LoginInfo_UnknowData = buf.GetByteArray(4); //buf.GetInt()
                    Client.ServerTime = buf.GetByteArray(4);

                    len = buf.GetChar();
                    Client.QQUser.QQKey.LoginInfo_Data_Token = buf.GetByteArray(len);
                    len = buf.GetChar();
                    Client.QQUser.QQKey.LoginInfo_Magic_Token = buf.GetByteArray(len);
                    Client.QQUser.QQKey.LoginInfo_Key1 = buf.GetByteArray(16);
                    buf.GetChar();//0x00 00
                    if (buf.Position + 3 < buf.Length)//判斷來的包是否包含LoginInfo_Key3 因為有的版本沒這個key 應該說本人用的正式版本沒這個
                    {
                        Client.QQUser.QQKey.LoginInfo_Key3 = buf.GetByteArray(16);
            #if DEBUG
                        Client.LogManager.Log(ToString() + "Client.QQUser.QQKey.LoginInfo_Key3:" + Utils.Util.ToHex(Client.QQUser.QQKey.LoginInfo_Key3));
            #endif
                    }
                    buf.GetChar();//0x00 00
                    return;
                case 0x33:
                case 0x51://denied!
                    Client.LogManager.Log(ToString() + ":0x" + ReplyCode.ToString("X2") + " Denied!");
                    break;
                case 0xBF:
                    Client.LogManager.Log(ToString() + ":0x" + ReplyCode.ToString("X2") + " No this QQ number!");
                    break;
                case 0x34:
                    Client.LogManager.Log(ToString() + ":0x" + ReplyCode.ToString("X2") + " Wrong password!");
                    break;
                default:
                    Client.LogManager.Log(ToString() + ":0x" + ReplyCode.ToString("X2") + " Unknow ReplyCode!");
                    break;

            }
            buf.Position = 11;
            len =(int) buf.GetChar();
            byte[] data = buf.GetByteArray(len);
            ReplyMessage = Utils.Util.GetString(data);

            Client.LogManager.Log(ToString() + ":0x" + ReplyCode.ToString("X2") + " Message Data(UTF-8): "+Utils.Util.ToHex(data)+"-->" + ReplyMessage);
        }
開發者ID:leaker,項目名稱:fuhj-widgets,代碼行數:55,代碼來源:LoginVerifyReplyPacket.cs


注:本文中的System.ByteBuffer.Get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。