The segments field is composed of a number cSegments of SegmentDescription fields. Each SegmentDescription field corresponds to a content segment in the order in which they appear in the original content. Every segment except for the last segment must be exactly 32 MB in size. The content information data structure defines the content range as described below. Content range = {Start offset, Length}Start offset = ullOffsetInContent + dwOffsetInFirstSegment, where ullOffsetInContent is taken from the first SegmentDescription in the segments field.Length =( Sum of cbSegment of all segments in segments field except for the first segment and last segment) + (cbSegment of first segment – dwOffsetInFirstSegment) + dwReadBytesInLastSegmentThe content range extends to the end of all the segments whose SegmentDescriptions are included in the Content Information except for the last segment, for which the number of bytes is limited to dwReadBytesInLastSegment instead of the total number of bytes actually present in the segment.
        /// <summary>
        /// Parse the information of segment.
        /// </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.</param>
        /// <param name="index">The start index.</param>
        /// <returns>Returns the segment infromation.</returns>
        private static SegmentDescription[] ParseSements(
            dwHashAlgo_Values dwHashAlgo,
            uint cSegments,
            byte[] data,
            ref int index)
        {
            SegmentDescription[] retSegments = new SegmentDescription[cSegments];
            int dataSize = GetDataSizeByHashAlgo(dwHashAlgo);

            for (int i = 0; i < retSegments.Length; i++)
            {
                retSegments[i].ullOffsetInContent = GetUInt64(data, ref index);
                retSegments[i].cbSegment          = GetUInt32(data, ref index);
                retSegments[i].cbBlockSize        = GetUInt32(data, ref index);
                byte[] tempSegmentHashOfData = GetBytes(data, ref index, dataSize);
                retSegments[i].SegmentHashOfData = tempSegmentHashOfData;
                byte[] tempSegmentSecret = GetBytes(data, ref index, dataSize);
                retSegments[i].SegmentSecret = tempSegmentSecret;
            }

            return(retSegments);
        }
        /// <summary>
        /// Parse the information of segment.
        /// </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.</param>
        /// <param name="index">The start index.</param>
        /// <returns>Returns the segment infromation.</returns>
        private static SegmentDescription[] ParseSements(
            dwHashAlgo_Values dwHashAlgo,
            uint cSegments,
            byte[] data,
            ref int index)
        {
            SegmentDescription[] retSegments = new SegmentDescription[cSegments];
            int dataSize = GetDataSizeByHashAlgo(dwHashAlgo);
            for (int i = 0; i < retSegments.Length; i++)
            {
                retSegments[i].ullOffsetInContent = GetUInt64(data, ref index);
                retSegments[i].cbSegment = GetUInt32(data, ref index);
                retSegments[i].cbBlockSize = GetUInt32(data, ref index);
                byte[] tempSegmentHashOfData = GetBytes(data, ref index, dataSize);
                retSegments[i].SegmentHashOfData = tempSegmentHashOfData;
                byte[] tempSegmentSecret = GetBytes(data, ref index, dataSize);
                retSegments[i].SegmentSecret = tempSegmentSecret;
            }

            return retSegments;
        }