Beispiel #1
0
        /// <summary>Compute the ObjectId for this tree</summary>
        /// <param name="ins"></param>
        /// <returns>ObjectId for this tree</returns>
        public virtual ObjectId ComputeId(ObjectInserter ins)
        {
            if (buf != null)
            {
                return(ins.IdFor(Constants.OBJ_TREE, buf, 0, ptr));
            }
            long len = overflowBuffer.Length();

            try
            {
                return(ins.IdFor(Constants.OBJ_TREE, len, overflowBuffer.OpenInputStream()));
            }
            catch (IOException e)
            {
                // this should never happen
                throw new RuntimeException(e);
            }
        }
Beispiel #2
0
		/// <summary>Compute the ObjectId for this tree</summary>
		/// <param name="ins"></param>
		/// <returns>ObjectId for this tree</returns>
		public virtual ObjectId ComputeId(ObjectInserter ins)
		{
			if (buf != null)
			{
				return ins.IdFor(Constants.OBJ_TREE, buf, 0, ptr);
			}
			long len = overflowBuffer.Length();
			try
			{
				return ins.IdFor(Constants.OBJ_TREE, len, overflowBuffer.OpenInputStream());
			}
			catch (IOException e)
			{
				// this should never happen
				throw new RuntimeException(e);
			}
		}