Skip to content

Commit f5aec13

Browse files
carlossanlopmairaw
authored andcommitted
Initial documentation for System.IO.Compression.BrotliStream, amending GZipStream/DeflateStream (#2001)
* Add documentation change for System.IO.Compression API classes: BrotliStream, DeflateStream, GZipStream. * First change for BrotliStream to make it look like GZipStream and DeflateStream. * Apply suggestions from code review Removing the 3 unexpected dots and the incorrectly closed remark. Co-Authored-By: carlossanlop <[email protected]> * Update BrotliStream.xml Removed the 2 comments with questions for reviewers. * Update GZipStream.xml Revert the change in ReadAsync. There is no method in GZipStream with 3 arguments byte[], int, int. * Update xml/System.IO.Compression/BrotliStream.xml Co-Authored-By: carlossanlop <[email protected]> * Update DeflateStream.xml Reverting these two changes too. There are no ReadSync/WriteSync functions in DeflateStream that receive byte[],int,int. * Update BrotliStream.xml Making sure all the "Consider using ReadAsync/WriteAsync" suggestions point to System.IO.Stream. * Update xml/System.IO.Compression/BrotliStream.xml Co-Authored-By: carlossanlop <[email protected]> * Update xml/System.IO.Compression/BrotliStream.xml Co-Authored-By: carlossanlop <[email protected]> * Update xml/System.IO.Compression/BrotliStream.xml Co-Authored-By: carlossanlop <[email protected]> * Update xml/System.IO.Compression/BrotliStream.xml Co-Authored-By: carlossanlop <[email protected]> * Update xml/System.IO.Compression/BrotliStream.xml Co-Authored-By: carlossanlop <[email protected]>
1 parent d692a11 commit f5aec13

File tree

3 files changed

+94
-69
lines changed

3 files changed

+94
-69
lines changed

xml/System.IO.Compression/BrotliStream.xml

Lines changed: 89 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</Base>
1515
<Interfaces />
1616
<Docs>
17-
<summary>To be added.</summary>
17+
<summary>Provides methods and properties used to compress and decompress streams by using the Brotli data format specification.</summary>
1818
<remarks>To be added.</remarks>
1919
</Docs>
2020
<Members>
@@ -34,9 +34,9 @@
3434
<Parameter Name="compressionLevel" Type="System.IO.Compression.CompressionLevel" />
3535
</Parameters>
3636
<Docs>
37-
<param name="stream">To be added.</param>
38-
<param name="compressionLevel">To be added.</param>
39-
<summary>To be added.</summary>
37+
<param name="stream">The stream to compress.</param>
38+
<param name="compressionLevel">One of the enumeration values that indicates whether to emphasize speed or compression efficiency when compressing the stream.</param>
39+
<summary>Initializes a new instance of the <see cref="T:System.IO.Compression.BrotliStream" /> class by using the specified stream and compression level.</summary>
4040
<remarks>To be added.</remarks>
4141
</Docs>
4242
</Member>
@@ -56,9 +56,9 @@
5656
<Parameter Name="mode" Type="System.IO.Compression.CompressionMode" />
5757
</Parameters>
5858
<Docs>
59-
<param name="stream">To be added.</param>
60-
<param name="mode">To be added.</param>
61-
<summary>To be added.</summary>
59+
<param name="stream">The stream to compress.</param>
60+
<param name="mode">One of the enumeration values that indicates whether to compress or decompress the stream.</param>
61+
<summary>Initializes a new instance of the <see cref="T:System.IO.Compression.BrotliStream" /> class by using the specified stream and compression mode.</summary>
6262
<remarks>To be added.</remarks>
6363
</Docs>
6464
</Member>
@@ -79,10 +79,10 @@
7979
<Parameter Name="leaveOpen" Type="System.Boolean" />
8080
</Parameters>
8181
<Docs>
82-
<param name="stream">To be added.</param>
83-
<param name="compressionLevel">To be added.</param>
84-
<param name="leaveOpen">To be added.</param>
85-
<summary>To be added.</summary>
82+
<param name="stream">The stream to compress.</param>
83+
<param name="compressionLevel">One of the enumeration values that indicates whether to emphasize speed or compression efficiency when compressing the stream.</param>
84+
<param name="leaveOpen"><see langword="true" /> to leave the stream open after disposing the <see cref="T:System.IO.Compression.BrotliStream" /> object; otherwise, <see langword="false" />.</param>
85+
<summary>Initializes a new instance of the <see cref="T:System.IO.Compression.BrotliStream" /> class by using the specified stream and compression level, and optionally leaves the stream open.</summary>
8686
<remarks>To be added.</remarks>
8787
</Docs>
8888
</Member>
@@ -103,10 +103,10 @@
103103
<Parameter Name="leaveOpen" Type="System.Boolean" />
104104
</Parameters>
105105
<Docs>
106-
<param name="stream">To be added.</param>
107-
<param name="mode">To be added.</param>
106+
<param name="stream">The stream to compress.</param>
107+
<param name="mode">One of the enumeration values that indicates whether to compress or decompress the stream.</param>
108108
<param name="leaveOpen">To be added.</param>
109-
<summary>To be added.</summary>
109+
<summary>Initializes a new instance of the <see cref="T:System.IO.Compression.BrotliStream" /> class by using the specified stream and compression mode, and optionally leaves the stream open.</summary>
110110
<remarks>To be added.</remarks>
111111
</Docs>
112112
</Member>
@@ -126,9 +126,10 @@
126126
<ReturnType>System.IO.Stream</ReturnType>
127127
</ReturnValue>
128128
<Docs>
129-
<summary>To be added.</summary>
130-
<value>To be added.</value>
129+
<summary>Gets a reference to the underlying stream.</summary>
130+
<value>A stream object that represents the underlying stream.</value>
131131
<remarks>To be added.</remarks>
132+
<exception cref="T:System.ObjectDisposedException">The underlying stream is closed.</exception>
132133
</Docs>
133134
</Member>
134135
<Member MemberName="BeginRead">
@@ -153,14 +154,19 @@
153154
<Parameter Name="asyncState" Type="System.Object" />
154155
</Parameters>
155156
<Docs>
156-
<param name="buffer">To be added.</param>
157-
<param name="offset">To be added.</param>
158-
<param name="count">To be added.</param>
159-
<param name="asyncCallback">To be added.</param>
160-
<param name="asyncState">To be added.</param>
161-
<summary>To be added.</summary>
162-
<returns>To be added.</returns>
157+
<param name="buffer">The buffer from which data will be read.</param>
158+
<param name="offset">The byte offset in <paramref name="array" /> at which to begin reading data from the stream.</param>
159+
<param name="count">To maximum number of bytes to read.</param>
160+
<param name="asyncCallback">An optional asynchronous callback, to be called when the read operation is complete.</param>
161+
<param name="asyncState">A user-provided object that distinguishes this particular asynchronous read request from other requests.</param>
162+
<summary>Begins an asynchronous read operation. (Consider using the <see cref="M:System.IO.Stream.ReadAsync(System.Byte[],System.Int32,System.Int32)" /> method instead.)</summary>
163+
<returns>An object that represents the asynchronous read operation, which could still be pending.</returns>
163164
<remarks>To be added.</remarks>
165+
<exception cref="T:System.IO.IOException">The method tried to read asynchronously past the end of the stream, or a disk error occurred.</exception>
166+
<exception cref="T:System.ArgumentException">One or more of the arguments is invalid.</exception>
167+
<exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed.</exception>
168+
<exception cref="T:System.NotSupportedException">The current <see cref="T:System.IO.Compression.BrotliStream" /> implementation does not support the read operation.</exception>
169+
<exception cref="T:System.InvalidOperationException">This call cannot be completed.</exception>
164170
</Docs>
165171
</Member>
166172
<Member MemberName="BeginWrite">
@@ -185,14 +191,19 @@
185191
<Parameter Name="asyncState" Type="System.Object" />
186192
</Parameters>
187193
<Docs>
188-
<param name="buffer">To be added.</param>
189-
<param name="offset">To be added.</param>
190-
<param name="count">To be added.</param>
191-
<param name="asyncCallback">To be added.</param>
192-
<param name="asyncState">To be added.</param>
193-
<summary>To be added.</summary>
194-
<returns>To be added.</returns>
194+
<param name="buffer">The buffer from which data will be written.</param>
195+
<param name="offset">The byte offset in <paramref name="array" /> at which to begin writing data from the stream.</param>
196+
<param name="count">The maximum number of bytes to write.</param>
197+
<param name="asyncCallback">An optional asynchronous callback, to be called when the write operation is complete.</param>
198+
<param name="asyncState">A user-provided object that distinguishes this particular asynchronous write request from other requests.</param>
199+
<summary>Begins an asynchronous write operation. (Consider using the <see cref="M:System.IO.Stream.WriteAsync(System.Byte[],System.Int32,System.Int32)" /> method instead.)</summary>
200+
<returns>An object that represents the asynchronous write operation, which could still be pending.</returns>
195201
<remarks>To be added.</remarks>
202+
<exception cref="T:System.IO.IOException">The method tried to write asynchronously past the end of the stream, or a disk error occurred.</exception>
203+
<exception cref="T:System.ArgumentException">One or more of the arguments is invalid.</exception>
204+
<exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed.</exception>
205+
<exception cref="T:System.NotSupportedException">The current <see cref="T:System.IO.Compression.BrotliStream" /> implementation does not support the write operation.</exception>
206+
<exception cref="T:System.InvalidOperationException">The write operation cannot be performed because the stream is closed.</exception>
196207
</Docs>
197208
</Member>
198209
<Member MemberName="CanRead">
@@ -211,8 +222,8 @@
211222
<ReturnType>System.Boolean</ReturnType>
212223
</ReturnValue>
213224
<Docs>
214-
<summary>To be added.</summary>
215-
<value>To be added.</value>
225+
<summary>Gets a value indicating whether the stream supports reading while decompressing a file.</summary>
226+
<value><see langword="true" /> if the <see cref="T:System.IO.Compression.CompressionMode" /> value is <see langword="Decompress," /> and the underlying stream supports reading and is not closed; otherwise, <see langword="false" />.</value>
216227
<remarks>To be added.</remarks>
217228
</Docs>
218229
</Member>
@@ -232,8 +243,8 @@
232243
<ReturnType>System.Boolean</ReturnType>
233244
</ReturnValue>
234245
<Docs>
235-
<summary>To be added.</summary>
236-
<value>To be added.</value>
246+
<summary>Gets a value indicating whether the stream supports seeking.</summary>
247+
<value><see langword="false" /> in all cases.</value>
237248
<remarks>To be added.</remarks>
238249
</Docs>
239250
</Member>
@@ -253,8 +264,8 @@
253264
<ReturnType>System.Boolean</ReturnType>
254265
</ReturnValue>
255266
<Docs>
256-
<summary>To be added.</summary>
257-
<value>To be added.</value>
267+
<summary>Gets a value indicating whether the stream supports writing.</summary>
268+
<value><see langword="true" /> if the <see cref="T:System.IO.Compression.CompressionMode" /> value is <see langword="Compress" />, and the underlying stream supports writing and is not closed; otherwise, <see langword="false" />.</value>
258269
<remarks>To be added.</remarks>
259270
</Docs>
260271
</Member>
@@ -277,8 +288,8 @@
277288
<Parameter Name="disposing" Type="System.Boolean" />
278289
</Parameters>
279290
<Docs>
280-
<param name="disposing">To be added.</param>
281-
<summary>To be added.</summary>
291+
<param name="disposing"><see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
292+
<summary>Releases the unmanaged resources used by the <see cref="T:System.IO.Compression.BrotliStream" /> and optionally releases the managed resources.</summary>
282293
<remarks>To be added.</remarks>
283294
</Docs>
284295
</Member>
@@ -323,10 +334,13 @@
323334
<Parameter Name="asyncResult" Type="System.IAsyncResult" />
324335
</Parameters>
325336
<Docs>
326-
<param name="asyncResult">To be added.</param>
327-
<summary>To be added.</summary>
328-
<returns>To be added.</returns>
337+
<param name="asyncResult">The reference to the pending asynchronous request to finish.</param>
338+
<summary>Waits for the pending asynchronous read to complete. (Consider using the <see cref="M:System.IO.Stream.ReadAsync(System.Byte[],System.Int32,System.Int32)" /> method instead.)</summary>
339+
<returns>The number of bytes read from the stream, between 0 (zero) and the number of bytes you requested. <see cref="T:System.IO.Compression.BrotliStream" /> returns 0 only at the end of the stream; otherwise, it blocks until at least one byte is available.</returns>
329340
<remarks>To be added.</remarks>
341+
<exception cref="T:System.ArgumentNullException"><paramref name="asyncResult" /> is <see langword="null" />.</exception>
342+
<exception cref="T:System.ArgumentException"><paramref name="asyncResult" /> did not originate from a <see cref="M:System.IO.Compression.BrotliStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> method on the current stream.</exception>
343+
<exception cref="T:System.InvalidOperationException">The end operation cannot be performed because the stream is closed.</exception>
330344
</Docs>
331345
</Member>
332346
<Member MemberName="EndWrite">
@@ -348,9 +362,10 @@
348362
<Parameter Name="asyncResult" Type="System.IAsyncResult" />
349363
</Parameters>
350364
<Docs>
351-
<param name="asyncResult">To be added.</param>
352-
<summary>To be added.</summary>
365+
<param name="asyncResult">The object that represents the asynchronous call.</param>
366+
<summary>Handles the end of an asynchronous write operation. (Consider using the <see cref="M:System.IO.Stream.WriteAsync(System.Byte[],System.Int32,System.Int32)" /> method instead.)</summary>
353367
<remarks>To be added.</remarks>
368+
<exception cref="T:System.InvalidOperationException">The underlying stream is closed or <see langword="null" />.</exception>
354369
</Docs>
355370
</Member>
356371
<Member MemberName="Flush">
@@ -370,7 +385,7 @@
370385
</ReturnValue>
371386
<Parameters />
372387
<Docs>
373-
<summary>To be added.</summary>
388+
<summary>The current implementation of this method has no functionality.</summary>
374389
<remarks>To be added.</remarks>
375390
</Docs>
376391
</Member>
@@ -414,9 +429,10 @@
414429
<ReturnType>System.Int64</ReturnType>
415430
</ReturnValue>
416431
<Docs>
417-
<summary>To be added.</summary>
418-
<value>To be added.</value>
432+
<summary>This property is not supported and always throws a <see cref="T:System.NotSupportedException" />.</summary>
433+
<value>A long value.</value>
419434
<remarks>To be added.</remarks>
435+
<exception cref="T:System.NotSupportedException">This property is not supported on this stream.</exception>
420436
</Docs>
421437
</Member>
422438
<Member MemberName="Position">
@@ -435,9 +451,10 @@
435451
<ReturnType>System.Int64</ReturnType>
436452
</ReturnValue>
437453
<Docs>
438-
<summary>To be added.</summary>
439-
<value>To be added.</value>
454+
<summary>This property is not supported and always throws a <see cref="T:System.NotSupportedException" />.</summary>
455+
<value>A long value.</value>
440456
<remarks>To be added.</remarks>
457+
<exception cref="T:System.NotSupportedException">This property is not supported on this stream.</exception>
441458
</Docs>
442459
</Member>
443460
<Member MemberName="Read">
@@ -486,12 +503,18 @@
486503
<Parameter Name="count" Type="System.Int32" />
487504
</Parameters>
488505
<Docs>
489-
<param name="buffer">To be added.</param>
490-
<param name="offset">To be added.</param>
491-
<param name="count">To be added.</param>
492-
<summary>To be added.</summary>
493-
<returns>To be added.</returns>
506+
<param name="buffer">The array used to store decompressed bytes.</param>
507+
<param name="offset">The byte offset in <paramref name="buffer" /> at which the read bytes will be placed.</param>
508+
<param name="count">The maximum number of decompressed bytes to read.</param>
509+
<summary>Reads a number of decompressed bytes into the specified byte array.</summary>
510+
<returns>The number of bytes that were decompressed into the byte array. If the end of the stream has been reached, zero or the number of bytes read is returned.</returns>
494511
<remarks>To be added.</remarks>
512+
<exception cref="T:System.ArgumentNullException"><paramref name="buffer" /> is <see langword="null" />.</exception>
513+
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.IO.Compression.CompressionMode" /> value was <see langword="Compress" /> when the object was created, or there is already an active asynchronous operation on this stream.</exception>
514+
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="offset" /> or <paramref name="count" /> is less than zero.</exception>
515+
<exception cref="T:System.ArgumentException">The <paramref name="buffer" /> length minus the index starting point is less than <paramref name="count" />.</exception>
516+
<exception cref="T:System.IO.InvalidDataException">The data is in an invalid format.</exception>
517+
<exception cref="T:System.ObjectDisposedException">The underlying stream is null or closed.</exception>
495518
</Docs>
496519
</Member>
497520
<Member MemberName="ReadAsync">
@@ -569,11 +592,12 @@
569592
<Parameter Name="origin" Type="System.IO.SeekOrigin" />
570593
</Parameters>
571594
<Docs>
572-
<param name="offset">To be added.</param>
573-
<param name="origin">To be added.</param>
574-
<summary>To be added.</summary>
575-
<returns>To be added.</returns>
595+
<param name="offset">The location in the stream.</param>
596+
<param name="origin">One of the <see cref="T:System.IO.SeekOrigin" /> values.</param>
597+
<summary>This property is not supported and always throws a <see cref="T:System.NotSupportedException" />.</summary>
598+
<returns>A long value.</returns>
576599
<remarks>To be added.</remarks>
600+
<exception cref="T:System.NotSupportedException">This property is not supported on this stream.</exception>
577601
</Docs>
578602
</Member>
579603
<Member MemberName="SetLength">
@@ -595,8 +619,8 @@
595619
<Parameter Name="value" Type="System.Int64" />
596620
</Parameters>
597621
<Docs>
598-
<param name="value">To be added.</param>
599-
<summary>To be added.</summary>
622+
<param name="value">The length of the stream.</param>
623+
<summary>This property is not supported and always throws a <see cref="T:System.NotSupportedException" />.</summary>
600624
<remarks>To be added.</remarks>
601625
</Docs>
602626
</Member>
@@ -645,11 +669,12 @@
645669
<Parameter Name="count" Type="System.Int32" />
646670
</Parameters>
647671
<Docs>
648-
<param name="buffer">To be added.</param>
649-
<param name="offset">To be added.</param>
650-
<param name="count">To be added.</param>
651-
<summary>To be added.</summary>
672+
<param name="buffer">The buffer containing the data to compress.</param>
673+
<param name="offset">The byte offset in <paramref name="array" /> from which the bytes will be read.</param>
674+
<param name="count">The maximum number of bytes to write.</param>
675+
<summary>Writes compressed bytes to the underlying stream from the specified byte array.</summary>
652676
<remarks>To be added.</remarks>
677+
<exception cref="T:System.ObjectDisposedException">The write operation cannot be performed because the stream is closed.</exception>
653678
</Docs>
654679
</Member>
655680
<Member MemberName="WriteAsync">
@@ -708,4 +733,4 @@
708733
</Docs>
709734
</Member>
710735
</Members>
711-
</Type>
736+
</Type>

xml/System.IO.Compression/DeflateStream.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1465,4 +1465,4 @@ The end write call is invalid.</exception>
14651465
</Docs>
14661466
</Member>
14671467
</Members>
1468-
</Type>
1468+
</Type>

0 commit comments

Comments
 (0)