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


C# Writer.Write方法代码示例

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


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

示例1: Read

 public override void Read(object input, ObjectReader reader, Writer writer, PartialOptions optionsOverride)
 {
     if ((optionsOverride.EnumSerialization ?? reader.Options.EnumSerialization) == EnumSerialization.AsString)
         writer.Write(input.ToString());
     else
         writer.Write((int)input);
 }
开发者ID:soxtoby,项目名称:ForSerial,代码行数:7,代码来源:EnumDefinition.cs

示例2: Build

		public override byte[] Build()
		{
			MemoryStream ms = new MemoryStream(Size);
			Writer writer = new Writer(ms);

			writer.Write(Id);
			writer.Write((Int32)Type);

			return ms.GetBuffer();
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:10,代码来源:RequestSocialAction.cs

示例3: Build

		public override byte[] Build()
		{
			MemoryStream ms = new MemoryStream(5); // + Raw.length
			Writer writer = new Writer(ms);

			writer.Write(Id);
			writer.Write(Protocol);

			return ms.GetBuffer();
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:10,代码来源:ProtocolVersion.cs

示例4: Build

		public override byte[] Build()
		{
			MemoryStream temp = new MemoryStream(128);
			Writer writer = new Writer(temp);

			writer.Seek(0x62, SeekOrigin.Begin);
			writer.WriteString(Login, Encoding.ASCII);
			writer.Seek(0x70, SeekOrigin.Begin);
			writer.WriteString(Password, Encoding.ASCII);


			MemoryStream ms = new MemoryStream(168);
			writer = new Writer(ms);

			writer.Write(Id);
			writer.Write(Encrypt(temp.GetBuffer()));
			writer.Write(SessionId);
			writer.Write(GameGuard);

			ulong chk = Utils.CheckSum(ms.GetBuffer(), 160);
			writer.Write((byte)(chk & 0xff));
			writer.Write((byte)(chk >> 0x08 & 0xff));
			writer.Write((byte)(chk >> 0x10 & 0xff));
			writer.Write((byte)(chk >> 0x18 & 0xff));
			writer.Write((Int32)0);

			return ms.GetBuffer();
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:28,代码来源:RequestAuthLogin.cs

示例5: Build

		public override byte[] Build()
		{
			MemoryStream ms = new MemoryStream(Size);
			Writer writer = new Writer(ms);

			writer.Write(Id);
			writer.Write(ObjectId);
			writer.Write(Count);

			return ms.GetBuffer();
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:11,代码来源:RequestCrystallizeItem.cs

示例6: Build

		public override byte[] Build()
		{
			MemoryStream ms = new MemoryStream(Size);
			Writer writer = new Writer(ms);

			writer.Write(Id);
			writer.WriteString(Name, Encoding);
			writer.Write((Int32)Loot);

			return ms.GetBuffer();
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:11,代码来源:RequestJoinParty.cs

示例7: Build

		public override byte[] Build()
		{
			MemoryStream ms = new MemoryStream(10);
			Writer writer = new Writer(ms);

			writer.Write(Id);
			writer.Write(SkillId);
			writer.Write((Int32)(Control ? 1 : 0));
			writer.Write((byte)(Shift ? 1 : 0));

			return ms.GetBuffer();
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:12,代码来源:RequestMagicSkillUse.cs

示例8: Build

		public override byte[] Build()
		{
			MemoryStream ms = new MemoryStream(Size);
			Writer writer = new Writer(ms);

			writer.Write(Id);
			writer.WriteString(Message, Encoding);
			writer.Write((Int32)Channel);
			if(NeedTarget())
				writer.WriteString(Target, Encoding);

			return ms.GetBuffer();
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:13,代码来源:Say2.cs

示例9: Build

		public override byte[] Build()
		{
			MemoryStream ms = new MemoryStream(17);
			Writer writer = new Writer(ms);

			writer.Write(Id);
			writer.Write(new byte[] {
				0x45, 0x00, 0x01, 0x00,
				0x1E, 0x37, 0xA2, 0xF5,
				0x00, 0x00, 0x00, 0x00,
				0x00, 0x00, 0x00, 0x00
			});

			return ms.GetBuffer();
		}
开发者ID:EligiusSantori,项目名称:L2Apf.NET,代码行数:15,代码来源:EnterWorld.cs

示例10: Read

 public override void Read(object input, ObjectReader reader, Writer writer, PartialOptions optionsOverride)
 {
     if (writer.CanWrite(input))
         writer.Write(input);
     else
         base.Read(input, reader, writer, optionsOverride);
 }
开发者ID:ZapTechnology,项目名称:ForSerial,代码行数:7,代码来源:ValueTypeDefinition.cs

示例11: Read

 public override void Read(object input, ObjectReader reader, Writer writer, PartialOptions optionsOverride)
 {
     if (ReferenceStructure(input, reader, optionsOverride))
         return;
     reader.AddReference();
     writer.Write(input);
 }
开发者ID:ZapTechnology,项目名称:ForSerial,代码行数:7,代码来源:ObjectDefinition.cs

示例12: Main

    public static int Main(string[] args)
    {
        string directory = args[0];
        string outfilename = args[1];

        Directory d = new Directory();
        uint nfiles = d.Load( directory, true );
        if(nfiles == 0) return 1;
        //System.Console.WriteLine( "Files:\n" + d.toString() );

        // Implement fast path ?
        // Scanner s = new Scanner();

        string descriptor = "My_Descriptor";
        FilenamesType filenames = d.GetFilenames();

        gdcm.DICOMDIRGenerator gen = new DICOMDIRGenerator();
        gen.SetFilenames( filenames );
        gen.SetDescriptor( descriptor );
        if( !gen.Generate() )
          {
          return 1;
          }

        gdcm.FileMetaInformation.SetSourceApplicationEntityTitle( "GenerateDICOMDIR" );
        gdcm.Writer writer = new Writer();
        writer.SetFile( gen.GetFile() );
        writer.SetFileName( outfilename );
        if( !writer.Write() )
          {
          return 1;
          }

        return 0;
    }
开发者ID:jcfr,项目名称:Gdcm,代码行数:35,代码来源:GenerateDICOMDIR.cs

示例13: Writes_List

        public void Writes_List()
        {
            var el = this.ParseSingle("(a b c)");
            Writer writer = new Writer();

            string s = writer.Write(el);
            Assert.AreEqual("(A B C)", s);
        }
开发者ID:taucode,项目名称:copperlisp,代码行数:8,代码来源:WriterTests.cs

示例14: Read

 public override void Read(object input, ObjectReader reader, Writer writer, PartialOptions optionsOverride)
 {
     Guid? guid = input as Guid?;
     if (guid == null)
         writer.WriteNull();
     else
         writer.Write(guid.ToString());
 }
开发者ID:soxtoby,项目名称:ForSerial,代码行数:8,代码来源:GuidDefinition.cs

示例15: Copy

 public void Copy(Reader reader, Writer writer)
 {
     char c = reader.Read();
     while (c != EOF)
     {
         writer.Write(c);
     }
 }
开发者ID:imsunil,项目名称:DeCoder,代码行数:8,代码来源:Copy.cs


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