@@ -14,7 +14,7 @@ namespace System.Net.Http
14
14
{
15
15
/// <summary>
16
16
/// Provides an <see cref="HttpContent"/> implementation that exposes an output <see cref="Stream"/>
17
- /// which can be written to directly. The ability to push data to the output stream differs from the
17
+ /// which can be written to directly. The ability to push data to the output stream differs from the
18
18
/// <see cref="StreamContent"/> where data is pulled and not pushed.
19
19
/// </summary>
20
20
public class PushStreamContent : HttpContent
@@ -24,8 +24,8 @@ public class PushStreamContent : HttpContent
24
24
/// <summary>
25
25
/// Initializes a new instance of the <see cref="PushStreamContent"/> class. The
26
26
/// <paramref name="onStreamAvailable"/> action is called when an output stream
27
- /// has become available allowing the action to write to it directly. When the
28
- /// stream is closed, it will signal to the content that is has completed and the
27
+ /// has become available allowing the action to write to it directly. When the
28
+ /// stream is closed, it will signal to the content that it has completed and the
29
29
/// HTTP request or response will be completed.
30
30
/// </summary>
31
31
/// <param name="onStreamAvailable">The action to call when an output stream is available.</param>
@@ -35,10 +35,11 @@ public PushStreamContent(Action<Stream, HttpContent, TransportContext> onStreamA
35
35
}
36
36
37
37
/// <summary>
38
- /// Initializes a new instance of the <see cref="PushStreamContent"/> class.
38
+ /// Initializes a new instance of the <see cref="PushStreamContent"/> class.
39
39
/// </summary>
40
- /// <param name="onStreamAvailable">The action to call when an output stream is available. The stream is automatically
41
- /// closed when the return task is completed.</param>
40
+ /// <param name="onStreamAvailable">The action to call when an output stream is available. When the
41
+ /// output stream is closed or disposed, it will signal to the content that it has completed and the
42
+ /// HTTP request or response will be completed.</param>
42
43
public PushStreamContent ( Func < Stream , HttpContent , TransportContext , Task > onStreamAvailable )
43
44
: this ( onStreamAvailable , ( MediaTypeHeaderValue ) null )
44
45
{
@@ -47,6 +48,8 @@ public PushStreamContent(Func<Stream, HttpContent, TransportContext, Task> onStr
47
48
/// <summary>
48
49
/// Initializes a new instance of the <see cref="PushStreamContent"/> class with the given media type.
49
50
/// </summary>
51
+ /// <param name="onStreamAvailable">The action to call when an output stream is available.</param>
52
+ /// <param name="mediaType">The value of the Content-Type content header on an HTTP response.</param>
50
53
public PushStreamContent ( Action < Stream , HttpContent , TransportContext > onStreamAvailable , string mediaType )
51
54
: this ( Taskify ( onStreamAvailable ) , new MediaTypeHeaderValue ( mediaType ) )
52
55
{
@@ -55,6 +58,10 @@ public PushStreamContent(Action<Stream, HttpContent, TransportContext> onStreamA
55
58
/// <summary>
56
59
/// Initializes a new instance of the <see cref="PushStreamContent"/> class with the given media type.
57
60
/// </summary>
61
+ /// <param name="onStreamAvailable">The action to call when an output stream is available. When the
62
+ /// output stream is closed or disposed, it will signal to the content that it has completed and the
63
+ /// HTTP request or response will be completed.</param>
64
+ /// <param name="mediaType">The value of the Content-Type content header on an HTTP response.</param>
58
65
public PushStreamContent ( Func < Stream , HttpContent , TransportContext , Task > onStreamAvailable , string mediaType )
59
66
: this ( onStreamAvailable , new MediaTypeHeaderValue ( mediaType ) )
60
67
{
@@ -63,6 +70,8 @@ public PushStreamContent(Func<Stream, HttpContent, TransportContext, Task> onStr
63
70
/// <summary>
64
71
/// Initializes a new instance of the <see cref="PushStreamContent"/> class with the given <see cref="MediaTypeHeaderValue"/>.
65
72
/// </summary>
73
+ /// <param name="onStreamAvailable">The action to call when an output stream is available.</param>
74
+ /// <param name="mediaType">The value of the Content-Type content header on an HTTP response.</param>
66
75
public PushStreamContent ( Action < Stream , HttpContent , TransportContext > onStreamAvailable , MediaTypeHeaderValue mediaType )
67
76
: this ( Taskify ( onStreamAvailable ) , mediaType )
68
77
{
@@ -71,6 +80,10 @@ public PushStreamContent(Action<Stream, HttpContent, TransportContext> onStreamA
71
80
/// <summary>
72
81
/// Initializes a new instance of the <see cref="PushStreamContent"/> class with the given <see cref="MediaTypeHeaderValue"/>.
73
82
/// </summary>
83
+ /// <param name="onStreamAvailable">The action to call when an output stream is available. When the
84
+ /// output stream is closed or disposed, it will signal to the content that it has completed and the
85
+ /// HTTP request or response will be completed.</param>
86
+ /// <param name="mediaType">The value of the Content-Type content header on an HTTP response.</param>
74
87
public PushStreamContent ( Func < Stream , HttpContent , TransportContext , Task > onStreamAvailable , MediaTypeHeaderValue mediaType )
75
88
{
76
89
if ( onStreamAvailable == null )
@@ -98,8 +111,8 @@ private static Func<Stream, HttpContent, TransportContext, Task> Taskify(
98
111
}
99
112
100
113
/// <summary>
101
- /// When this method is called, it calls the action provided in the constructor with the output
102
- /// stream to write to. Once the action has completed its work it closes the stream which will
114
+ /// When this method is called, it calls the action provided in the constructor with the output
115
+ /// stream to write to. Once the action has completed its work it closes the stream which will
103
116
/// close this content instance and complete the HTTP request or response.
104
117
/// </summary>
105
118
/// <param name="stream">The <see cref="Stream"/> to which to write.</param>
@@ -142,8 +155,8 @@ public CompleteTaskOnCloseStream(Stream innerStream, TaskCompletionSource<bool>
142
155
143
156
#if NETFX_CORE
144
157
[ SuppressMessage (
145
- "Microsoft.Usage" ,
146
- "CA2215:Dispose methods should call base class dispose" ,
158
+ "Microsoft.Usage" ,
159
+ "CA2215:Dispose methods should call base class dispose" ,
147
160
Justification = "See comments, this is intentional." ) ]
148
161
protected override void Dispose ( bool disposing )
149
162
{
0 commit comments