Esempio n. 1
0
        /// <summary>
        /// Convert the SegmentDescription struct defined in adapter to stack
        /// </summary>
        /// <param name="segmentDescription">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.
        ///  </param>
        /// <returns>Return the SegmentDescription type defined in stack</returns>
        private static TestTools.StackSdk.BranchCache.Pccrc.SegmentDescription[] ConvertToStackForSegDescription(
            SegmentDescription[] segmentDescription)
        {
            TestTools.StackSdk.BranchCache.Pccrc.SegmentDescription[] segmentDescriptionStack
                = new TestTools.StackSdk.BranchCache.Pccrc.SegmentDescription[segmentDescription.Length];
            for (int i = 0; i < segmentDescriptionStack.Length; i++)
            {
                segmentDescriptionStack[i].cbBlockSize        = segmentDescription[i].CbBlockSize;
                segmentDescriptionStack[i].cbSegment          = segmentDescription[i].CbSegment;
                segmentDescriptionStack[i].SegmentHashOfData  = segmentDescription[i].SegmentHashOfData;
                segmentDescriptionStack[i].SegmentSecret      = segmentDescription[i].SegmentSecret;
                segmentDescriptionStack[i].ullOffsetInContent = segmentDescription[i].UllOffsetInContent;
            }

            return(segmentDescriptionStack);
        }
        /// <summary>
        /// Convert the SegmentDescription struct defined in adapter to stack 
        /// </summary>
        /// <param name="segmentDescription">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.
        ///  </param>
        /// <returns>Return the SegmentDescription type defined in stack</returns>
        private static TestTools.StackSdk.BranchCache.Pccrc.SegmentDescription[] ConvertToStackForSegDescription(
            SegmentDescription[] segmentDescription)
        {
            TestTools.StackSdk.BranchCache.Pccrc.SegmentDescription[] segmentDescriptionStack
                = new TestTools.StackSdk.BranchCache.Pccrc.SegmentDescription[segmentDescription.Length];
            for (int i = 0; i < segmentDescriptionStack.Length; i++)
            {
                segmentDescriptionStack[i].cbBlockSize = segmentDescription[i].CbBlockSize;
                segmentDescriptionStack[i].cbSegment = segmentDescription[i].CbSegment;
                segmentDescriptionStack[i].SegmentHashOfData = segmentDescription[i].SegmentHashOfData;
                segmentDescriptionStack[i].SegmentSecret = segmentDescription[i].SegmentSecret;
                segmentDescriptionStack[i].ullOffsetInContent = segmentDescription[i].UllOffsetInContent;
            }

            return segmentDescriptionStack;
        }