/// <summary>Insert this tree and obtain its ObjectId.</summary> /// <remarks>Insert this tree and obtain its ObjectId.</remarks> /// <param name="ins">the inserter to store the tree.</param> /// <returns>computed ObjectId of the tree</returns> /// <exception cref="System.IO.IOException">the tree could not be stored.</exception> public virtual ObjectId InsertTo(ObjectInserter ins) { if (buf != null) { return(ins.Insert(Constants.OBJ_TREE, buf, 0, ptr)); } long len = overflowBuffer.Length(); return(ins.Insert(Constants.OBJ_TREE, len, overflowBuffer.OpenInputStream())); }