本文整理汇总了C#中ObjectId.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectId.CopyTo方法的具体用法?C# ObjectId.CopyTo怎么用?C# ObjectId.CopyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectId
的用法示例。
在下文中一共展示了ObjectId.CopyTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: writeRef
public void writeRef(string name, ObjectId value)
{
MemoryStream m = new MemoryStream(Constants.OBJECT_ID_LENGTH * 2 + 1);
BinaryWriter b = new BinaryWriter(m);
value.CopyTo(b);
b.Write('\n');
b.Flush();
writeFile(ROOT_DIR + name, m.ToArray());
}
示例2: writeRef
/// <summary>
/// Overwrite (or create) a loose ref in the remote repository.
/// <para/>
/// This method creates any missing parent directories, if necessary.
/// </summary>
/// <param name="name">
/// name of the ref within the ref space, for example
/// <code>refs/heads/pu</code>.
/// </param>
/// <param name="value">new value to store in this ref. Must not be null.</param>
public void writeRef(string name, ObjectId value)
{
if (value == null)
throw new ArgumentNullException("value");
using (var m = new MemoryStream(Constants.OBJECT_ID_STRING_LENGTH + 1))
using (var b = new BinaryWriter(m))
{
value.CopyTo(b);
b.Write('\n');
b.Flush();
writeFile(ROOT_DIR + name, m.ToArray());
}
}
示例3: format
private void format(StringBuilder m, char[] idtmp, ObjectId id, string name)
{
m.Length = 0;
id.CopyTo(idtmp, m);
m.Append(' ');
m.Append(name);
}