当前位置: 首页>>代码示例>>C#>>正文


C# BinaryWriter.WriteOpcode方法代码示例

本文整理汇总了C#中System.IO.BinaryWriter.WriteOpcode方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryWriter.WriteOpcode方法的具体用法?C# BinaryWriter.WriteOpcode怎么用?C# BinaryWriter.WriteOpcode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.BinaryWriter的用法示例。


在下文中一共展示了BinaryWriter.WriteOpcode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EncodeInternal

 protected override void EncodeInternal(BinaryWriter output)
 {
     if (Value == 0.0d)
         output.WriteOpcode(MarshalOpcode.RealZero);
     else
     {
         output.WriteOpcode(MarshalOpcode.Real);
         output.Write(Value);
     }
 }
开发者ID:VizanArkonin,项目名称:EVEmu-live-packet-editor,代码行数:10,代码来源:PyFloat.cs

示例2: EncodeInternal

        protected override void EncodeInternal(BinaryWriter output)
        {
            switch (Value)
            {
                case true:
                    output.WriteOpcode(MarshalOpcode.BoolTrue);
                    break;

                case false:
                    output.WriteOpcode(MarshalOpcode.BoolFalse);
                    break;
            }
        }
开发者ID:VizanArkonin,项目名称:EVEmu-live-packet-editor,代码行数:13,代码来源:PyBool.cs

示例3: EncodeInternal

 protected override void EncodeInternal(BinaryWriter output)
 {
     output.WriteOpcode(MarshalOpcode.Token);
     if (RawToken != null)
         output.Write(RawToken);
     else if (Token != null)
         output.Write(Encoding.ASCII.GetBytes(Token));
     else
         throw new InvalidDataException("Fill either RawToken or Token with data for encoding");
 }
开发者ID:Almamu,项目名称:eveMarshal,代码行数:10,代码来源:PyToken.cs

示例4: EncodeInternal

 protected override void EncodeInternal(BinaryWriter output)
 {
     output.WriteOpcode(MarshalOpcode.ChecksumedStream);
     var ms = new MemoryStream();
     var tmp = new BinaryWriter(ms);
     Data.Encode(tmp);
     var data = ms.ToArray();
     Checksum = Adler32.Checksum(data);
     output.Write(Checksum);
     output.Write(data);
 }
开发者ID:VizanArkonin,项目名称:EVEmu-live-packet-editor,代码行数:11,代码来源:PyChecksumedStream.cs

示例5: EncodeInternal

 protected override void EncodeInternal(BinaryWriter output)
 {
     output.WriteOpcode(MarshalOpcode.SubStream);
     var tempMs = new MemoryStream();
     var temp = new BinaryWriter(tempMs);
     temp.Write((byte)0x7E);
     temp.Write((uint)0);
     Data.Encode(temp);
     output.WriteSizeEx((uint)tempMs.Length);
     output.Write(tempMs.ToArray());
 }
开发者ID:stschake,项目名称:eveMarshal,代码行数:11,代码来源:PySubStream.cs

示例6: EncodeInternal

        protected override void EncodeInternal(BinaryWriter output)
        {
            output.WriteOpcode(MarshalOpcode.SubStream);

            var memoryStream = new MemoryStream();
            var binaryWriter = new BinaryWriter(memoryStream);

            binaryWriter.Write(Marshal.Process(Data));

            output.WriteSizeEx((uint)memoryStream.Length);
            output.Write(memoryStream.ToArray());
        }
开发者ID:Reve,项目名称:EVESharp,代码行数:12,代码来源:PySubStream.cs

示例7: EncodeInternal

 protected override void EncodeInternal(BinaryWriter output)
 {
     if (Value == 1)
         output.WriteOpcode(MarshalOpcode.IntegerOne);
     else if (Value == 0)
         output.WriteOpcode(MarshalOpcode.IntegerZero);
     else if (Value == -1)
         output.WriteOpcode(MarshalOpcode.IntegerMinusOne);
     else if (Value < 127)
     {
         output.WriteOpcode(MarshalOpcode.IntegerByte);
         output.Write((byte)Value);
     }
     else if (Value < 32768)
     {
         output.WriteOpcode(MarshalOpcode.IntegerSignedShort);
         output.Write((short)Value);
     }
     else
     {
         output.WriteOpcode(MarshalOpcode.IntegerLong);
         output.Write(Value);
     }
 }
开发者ID:stschake,项目名称:eveMarshal,代码行数:24,代码来源:PyInt.cs

示例8: EncodeInternal

 protected override void EncodeInternal(BinaryWriter output)
 {
     output.WriteOpcode(MarshalOpcode.Buffer);
     output.WriteSizeEx(Data.Length);
     output.Write(Data);
 }
开发者ID:VizanArkonin,项目名称:EVEmu-live-packet-editor,代码行数:6,代码来源:PyBuffer.cs

示例9: EncodeInternal

 protected override void EncodeInternal(BinaryWriter output)
 {
     output.WriteOpcode(MarshalOpcode.Object);
     new PyString(Name).Encode(output);
     Arguments.Encode(output);
 }
开发者ID:VizanArkonin,项目名称:EVEmu-live-packet-editor,代码行数:6,代码来源:PyObjectData.cs

示例10: EncodeInternal

 protected override void EncodeInternal(BinaryWriter output)
 {
     output.WriteOpcode(IsType2 ? MarshalOpcode.ObjectEx2 : MarshalOpcode.ObjectEx1);
     Header.Encode(output);
     // list
     output.Write(PackedTerminator);
     // dict
     output.Write(PackedTerminator);
 }
开发者ID:stschake,项目名称:eveMarshal,代码行数:9,代码来源:PyObjectEx.cs

示例11: EncodeInternal

 protected override void EncodeInternal(BinaryWriter output)
 {
     output.WriteOpcode(MarshalOpcode.SubStruct);
     Definition.Encode(output);
 }
开发者ID:stschake,项目名称:eveMarshal,代码行数:5,代码来源:PySubStruct.cs

示例12: EncodeInternal

 protected override void EncodeInternal(BinaryWriter output)
 {
     output.WriteOpcode(MarshalOpcode.Dict);
     output.WriteSizeEx(Dictionary.Count);
     foreach (var pair in Dictionary)
     {
         pair.Value.Encode(output);
         pair.Key.Encode(output);
     }
 }
开发者ID:stschake,项目名称:eveMarshal,代码行数:10,代码来源:PyDict.cs

示例13: EncodeInternal

 protected override void EncodeInternal(BinaryWriter output)
 {
     output.WriteOpcode(MarshalOpcode.None);
 }
开发者ID:stschake,项目名称:eveMarshal,代码行数:4,代码来源:PyNone.cs

示例14: EncodeInternal

        protected override void EncodeInternal(BinaryWriter output)
        {
            output.WriteOpcode(IsType2 ? MarshalOpcode.ObjectEx2 : MarshalOpcode.ObjectEx1);
            Header.Encode(output);

            // list
            if (List != null)
            {
                if (List.Count > 0)
                {
                    foreach (PyObject item in List)
                    {
                        item.Encode(output);
                    }
                }
            }

            output.Write(PackedTerminator);

            // dict
            if (Dictionary != null)
            {
                if (Dictionary.Count > 0)
                {
                    foreach (var pair in Dictionary)
                    {
                        pair.Key.Encode(output);
                        pair.Value.Encode(output);
                    }
                }
            }

            output.Write(PackedTerminator);
        }
开发者ID:Reve,项目名称:EVESharp,代码行数:34,代码来源:PyObjectEx.cs

示例15: EncodeInternal

 protected override void EncodeInternal(BinaryWriter output)
 {
     output.WriteOpcode(MarshalOpcode.IntegerLongLong);
     output.Write(Value);
 }
开发者ID:stschake,项目名称:eveMarshal,代码行数:5,代码来源:PyLongLong.cs


注:本文中的System.IO.BinaryWriter.WriteOpcode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。