本文整理汇总了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);
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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());
}
示例15: Copy
public void Copy(Reader reader, Writer writer)
{
char c = reader.Read();
while (c != EOF)
{
writer.Write(c);
}
}