本文整理汇总了C#中Memory.Write方法的典型用法代码示例。如果您正苦于以下问题:C# Memory.Write方法的具体用法?C# Memory.Write怎么用?C# Memory.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Memory
的用法示例。
在下文中一共展示了Memory.Write方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Copy
public Memory Copy(int address)
{
mem_ref[] instance_table__ = this.instance_table.ToArray();
int shift__ = 0;
for (int i = 0; i < instance_table__.Length; ++i)
{
if (instance_table__[i].external == false)
{
int new_address = instance_table__[i].address - start_address + address;
int padding = instance_table__[i].GetPaddingCount(new_address);
shift__ += padding;
instance_table__[i].SetAddress(new_address, false);
}
}
byte[] buffer_ = new byte[this.Length + shift__];
Memory copy = new Memory(buffer_, this.start_address);
instance_table__[0].client.PointTo(copy);
copy.start_address = address;
copy.instance_table = new List<mem_ref>(instance_table__);
BinaryReader bin_reader = new BinaryReader(this);
for (int i = 0; i < copy.instance_table.Count; ++i)
{
if (instance_table__[i].external == false)
{
copy.Position = copy.instance_table[i].address - copy.start_address;
this.Position = this.instance_table[i].address - start_address;
int length = instance_table__[i].client.SizeOf;
copy.Write(bin_reader.ReadBytes(length), 0, length);
}
}
for (int i = 0; i < instance_table__.Length; ++i)
{
if (instance_table__[i].external == false)
{
instance_table__[i].SetAddress(instance_table__[i].address);
}
}
return copy;
}