/// <summary> /// Appends all blocks from a block array to this array. /// </summary> /// <param name="blocks">The source array.</param> public void Append(BlockArray blocks) { for (int i = 0; i < blocks.Count; i++) { Append(blocks.GetBlock(i)); } }
/// <summary> /// Appends blocks from a block array to this array. /// </summary> /// <param name="blocks">The source array.</param> /// <param name="index">Index of the first block to append.</param> /// <param name="count">Number of blocks to append.</param> public void Append(BlockArray blocks, int index, int count) { for (int i = index; i < count + index; i++) { Append(blocks.GetBlock(i)); } }
/// <summary> /// Appends a block array to the end of the underlying BlockArray. /// </summary> /// <param name="blocks">The array to append.</param> /// <remarks> /// The underyling block array's SetExactSize() method will be /// called before appending the block. The stream position will /// be set to the end of the stream before the method returns. /// /// This method is a performance improvement over writing the /// a buffer to the stream via one of the write methods. /// </remarks> public void Append(BlockArray blocks) { this.blocks.SetExactSize(length); for (int i = 0; i < blocks.Count; i++) { this.blocks.Append(blocks.GetBlock(i)); } length += blocks.Size; pos = length; }