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


C# ObjectId.CopyTo方法代码示例

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


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

示例1: Write

 /// <summary>Write an ObjectId and LF to the temporary file.</summary>
 /// <remarks>Write an ObjectId and LF to the temporary file.</remarks>
 /// <param name="id">
 /// the id to store in the file. The id will be written in hex,
 /// followed by a sole LF.
 /// </param>
 /// <exception cref="System.IO.IOException">
 /// the temporary file could not be written. The lock is released
 /// before throwing the underlying IO exception to the caller.
 /// </exception>
 /// <exception cref="Sharpen.RuntimeException">
 /// the temporary file could not be written. The lock is released
 /// before throwing the underlying exception to the caller.
 /// </exception>
 public virtual void Write(ObjectId id)
 {
     byte[] buf = new byte[Constants.OBJECT_ID_STRING_LENGTH + 1];
     id.CopyTo(buf, 0);
     buf[Constants.OBJECT_ID_STRING_LENGTH] = (byte)('\n');
     Write(buf);
 }
开发者ID:kenji-tan,项目名称:ngit,代码行数:21,代码来源:LockFile.cs

示例2: WriteRef

		/// <summary>Overwrite (or create) a loose ref in the remote repository.</summary>
		/// <remarks>
		/// Overwrite (or create) a loose ref in the remote repository.
		/// <p>
		/// This method creates any missing parent directories, if necessary.
		/// </remarks>
		/// <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>
		/// <exception cref="System.IO.IOException">
		/// writing is not supported, or attempting to write the file
		/// failed, possibly due to permissions or remote disk full, etc.
		/// </exception>
		internal virtual void WriteRef(string name, ObjectId value)
		{
			ByteArrayOutputStream b;
			b = new ByteArrayOutputStream(Constants.OBJECT_ID_STRING_LENGTH + 1);
			value.CopyTo(b);
			b.Write('\n');
			WriteFile(ROOT_DIR + name, b.ToByteArray());
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:23,代码来源:WalkRemoteObjectDatabase.cs


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