当前位置: 首页>>代码示例>>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;未经允许,请勿转载。