Exemple #1
0
        /// <summary>
        ///     Create a new <see cref="ProgressStream"/> that wraps the specified inner <see cref="Stream"/>.
        /// </summary>
        /// <param name="innerStream">
        ///     The inner stream.
        /// </param>
        /// <param name="streamDirection">
        ///     The direction in which the stream's data is expected to flow.
        /// </param>
        /// <param name="ownsStream">
        ///     Should the <see cref="ProgressStream"/> close the inner stream when it is closed?
        /// </param>
        public ProgressStream(Stream innerStream, StreamDirection streamDirection, bool ownsStream)
            : this(innerStream, streamDirection, ownsStream, DefaultSink.Int64())
        {
            if (_innerStream.CanSeek)
            {
                _sink.Total = _innerStream.Length;

                // AF: What about position?
            }
        }
Exemple #2
0
 /// <summary>
 ///     Create new progress content.
 /// </summary>
 /// <param name="innerContent">
 ///     The inner <see cref="HttpContent"/>.
 /// </param>
 /// <param name="bufferSize">
 ///     The buffer size to use when transferring the inner content.
 /// </param>
 public ProgressContent(HttpContent innerContent, int bufferSize)
     : this(innerContent, bufferSize, DefaultSink.Int64())
 {
 }
Exemple #3
0
 /// <summary>
 ///     Create new progress content.
 /// </summary>
 /// <param name="innerContent">
 ///     The inner <see cref="HttpContent"/>.
 /// </param>
 public ProgressContent(HttpContent innerContent)
     : this(innerContent, DefaultSink.Int64())
 {
 }