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


C# ByteBuffer.WriteByte方法代碼示例

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


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

示例1: write

        public static byte[] write()
        {
            byte[] temp = init();
            ByteBuffer buff = new ByteBuffer();
            buff.WriteD(temp.Length + 4);
            for (int i = 0; i < temp.Length - 1; i++)
            {
                buff.WriteByte(temp[i]);
            }
            buff.Resize(temp.Length + 4);
            size = buff.Length();

            return buff.Get_ByteArray();
        }
開發者ID:Novo,項目名稱:apbprivateserver,代碼行數:14,代碼來源:ANS_LOGIN_SUCCESS.cs

示例2: OnMessage

        public void OnMessage(ClientSession session, ByteBuffer buffer) {
            string str = buffer.ReadString();
            int uid = buffer.ReadInt();

            ushort commandId = (ushort)Protocal.Login;
            ByteBuffer newBuffer = new ByteBuffer();
            newBuffer.WriteShort(commandId);
            newBuffer.WriteByte(1);
            newBuffer.WriteString(str);
            SocketUtil.SendMessage(session, newBuffer);

            session.uid = uid;
            UserUtil.Add(uid, session);
            Console.WriteLine("OnMessage--->>>" + str + uid);
        }
開發者ID:alenwesker,項目名稱:SimpleFramework_NGUI,代碼行數:15,代碼來源:Login.cs

示例3: PatchRawSmallSection

        void PatchRawSmallSection(ByteBuffer buffer, MetadataBuilder metadata)
        {
            var length = ReadByte();
            buffer.WriteByte(length);
            Advance(2);

            buffer.WriteUInt16(0);

            var count = length / 12;

            PatchRawExceptionHandlers(buffer, metadata, count, false);
        }
開發者ID:beatcracker,項目名稱:GUILess-Reflexil,代碼行數:12,代碼來源:CodeReader.cs

示例4: PatchRawSection

        void PatchRawSection(ByteBuffer buffer, MetadataBuilder metadata)
        {
            var position = base.position;
            Align(4);
            buffer.WriteBytes(base.position - position);

            const byte fat_format = 0x40;
            const byte more_sects = 0x80;

            var flags = ReadByte();
            if ((flags & fat_format) == 0)
            {
                buffer.WriteByte(flags);
                PatchRawSmallSection(buffer, metadata);
            }
            else
                PatchRawFatSection(buffer, metadata);

            if ((flags & more_sects) != 0)
                PatchRawSection(buffer, metadata);
        }
開發者ID:beatcracker,項目名稱:GUILess-Reflexil,代碼行數:21,代碼來源:CodeReader.cs

示例5: PatchRawMethodBody

        public ByteBuffer PatchRawMethodBody(MethodDefinition method, CodeWriter writer, out MethodSymbols symbols)
        {
            var buffer = new ByteBuffer();
            symbols = new MethodSymbols(method.Name);

            this.method = method;
            reader.context = method;

            MoveTo(method.RVA);

            var flags = ReadByte();

            MetadataToken local_var_token;

            switch (flags & 0x3)
            {
                case 0x2: // tiny
                    buffer.WriteByte(flags);
                    local_var_token = MetadataToken.Zero;
                    symbols.code_size = flags >> 2;
                    PatchRawCode(buffer, symbols.code_size, writer);
                    break;
                case 0x3: // fat
                    base.position--;

                    PatchRawFatMethod(buffer, symbols, writer, out local_var_token);
                    break;
                default:
                    throw new NotSupportedException();
            }

            var symbol_reader = reader.module.symbol_reader;
            if (symbol_reader != null && writer.metadata.write_symbols)
            {
                symbols.method_token = GetOriginalToken(writer.metadata, method);
                symbols.local_var_token = local_var_token;
                symbol_reader.Read(symbols);
            }

            return buffer;
        }
開發者ID:beatcracker,項目名稱:GUILess-Reflexil,代碼行數:41,代碼來源:CodeReader.cs


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