/// <summary>
        /// Initializes a new instance of the <see cref="SegmentDownloader"/> class.
        /// </summary>
        /// <param name="stream">The stream.</param>
        /// <param name="downloadSegmentInfo">The download segment information.</param>
        /// <param name="segmentDownloadRateCalculator">The segment download rate calculator.</param>
        /// <exception cref="System.ArgumentNullException">downloadSegmentInfo</exception>
        public SegmentDownloader(Stream stream, DownloadSegmentPositions downloadSegmentInfo, ISegmentDownloadRateCalculator segmentDownloadRateCalculator)
        {
            if (downloadSegmentInfo == null)
            {
                throw new ArgumentNullException("downloadSegmentInfo");
            }

            m_Stream = stream;
            m_SegmentDownloadRateCalculator = segmentDownloadRateCalculator;
            m_StartPosition = downloadSegmentInfo.StartPosition;
            m_EndPosition = downloadSegmentInfo.EndPosition;
            m_CurrentPosition = StartPosition;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SegmentDownloader"/> class.
        /// </summary>
        /// <param name="stream">The stream.</param>
        /// <param name="downloadSegmentInfo">The download segment information.</param>
        /// <param name="segmentDownloadRateCalculator">The segment download rate calculator.</param>
        /// <exception cref="System.ArgumentNullException">downloadSegmentInfo</exception>
        public SegmentDownloader(Stream stream, DownloadSegmentPositions downloadSegmentInfo, ISegmentDownloadRateCalculator segmentDownloadRateCalculator)
        {
            if (downloadSegmentInfo == null)
            {
                throw new ArgumentNullException("downloadSegmentInfo");
            }

            m_Stream = stream;
            m_SegmentDownloadRateCalculator = segmentDownloadRateCalculator;
            m_StartPosition   = downloadSegmentInfo.StartPosition;
            m_EndPosition     = downloadSegmentInfo.EndPosition;
            m_CurrentPosition = StartPosition;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="SegmentDownloader"/> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="networkProtocolProvider">The network protocol provider.</param>
 /// <param name="downloadSegmentInfo">The download segment information.</param>
 /// <param name="segmentDownloadRateCalculator">The segment download rate calculator.</param>
 public SegmentDownloader(DownloadFileInfo file, INetworkProtocolProvider networkProtocolProvider, DownloadSegmentPositions downloadSegmentInfo, ISegmentDownloadRateCalculator segmentDownloadRateCalculator)
     : this(null, downloadSegmentInfo, segmentDownloadRateCalculator)
 {
     m_File = file;
     m_NetworkProtocolProvider = networkProtocolProvider;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SegmentDownloader"/> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="networkProtocolProvider">The network protocol provider.</param>
 /// <param name="downloadSegmentInfo">The download segment information.</param>
 /// <param name="segmentDownloadRateCalculator">The segment download rate calculator.</param>
 public SegmentDownloader(DownloadFileInfo file, INetworkProtocolProvider networkProtocolProvider, DownloadSegmentPositions downloadSegmentInfo, ISegmentDownloadRateCalculator segmentDownloadRateCalculator)
     : this(null, downloadSegmentInfo, segmentDownloadRateCalculator)
 {
     m_File = file;
     m_NetworkProtocolProvider = networkProtocolProvider;
 }