/// <summary> /// Parse the information of the block. /// </summary> /// <param name="dwHashAlgo">The hash algorithm to use.</param> /// <param name="cSegments">The number of segments which intersect the content range and hence are contained /// in the Content Information structure.</param> /// <param name="data">The byte data in little-endian order.</param> /// <param name="index">The start index.</param> /// <returns>Returns the block infromation.</returns> private static SegmentContentBlocks[] ParseBlocks( dwHashAlgo_Values dwHashAlgo, uint cSegments, byte[] data, ref int index) { SegmentContentBlocks[] retBlocks = new SegmentContentBlocks[cSegments]; int dataSize = GetDataSizeByHashAlgo(dwHashAlgo); for (int i = 0; i < retBlocks.Length; i++) { retBlocks[i].cBlocks = GetUInt32(data, ref index); retBlocks[i].BlockHashes = GetBytes( data, ref index, (int)(dataSize * retBlocks[i].cBlocks)); } return(retBlocks); }
/// <summary> /// Parse the information of the block. /// </summary> /// <param name="dwHashAlgo">The hash algorithm to use.</param> /// <param name="cSegments">The number of segments which intersect the content range and hence are contained /// in the Content Information structure.</param> /// <param name="data">The byte data in little-endian order.</param> /// <param name="index">The start index.</param> /// <returns>Returns the block infromation.</returns> private static SegmentContentBlocks[] ParseBlocks( dwHashAlgo_Values dwHashAlgo, uint cSegments, byte[] data, ref int index) { SegmentContentBlocks[] retBlocks = new SegmentContentBlocks[cSegments]; int dataSize = GetDataSizeByHashAlgo(dwHashAlgo); for (int i = 0; i < retBlocks.Length; i++) { retBlocks[i].cBlocks = GetUInt32(data, ref index); retBlocks[i].BlockHashes = GetBytes( data, ref index, (int)(dataSize * retBlocks[i].cBlocks)); } return retBlocks; }