Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions xml/System.IO.Compression/BrotliStream.xml
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@
<summary>Asynchronously releases the unmanaged resources used by the <see cref="T:System.IO.Compression.BrotliStream" />.</summary>
<returns>A task that represents the asynchronous dispose operation.</returns>
<remarks>
<para>The `DisposeAsync` method lets you perform a resource-intensive dispose operation without blocking the main thread. This performance consideration is particularly important in a Windows 8.x Store app or desktop app where a time-consuming stream operation can block the UI thread and make your app appear as if it is not working. The async methods are used in conjunction with the <see langword="async" /> and <see langword="await" /> keywords in Visual Basic and C#.</para>
<para>The `DisposeAsync` method lets you perform a resource-intensive dispose operation without blocking the main thread. This performance consideration is particularly important in a desktop app where a time-consuming stream operation can block the UI thread and make your app appear as if it is not working. The async methods are used in conjunction with the <see langword="async" /> and <see langword="await" /> keywords in Visual Basic and C#.</para>
<para>This method disposes the Brotli stream by writing any changes to the backing store and closing the stream to release resources.</para>
<para>Calling `DisposeAsync` allows the resources used by the <see cref="T:System.IO.Compression.BrotliStream" /> to be reallocated for other purposes. For more information, see <see href="/dotnet/standard/garbage-collection/unmanaged">Cleaning Up Unmanaged Resources</see>.</para>
</remarks>
Expand Down Expand Up @@ -916,7 +916,7 @@
<summary>Asynchronously reads a sequence of bytes from the current Brotli stream, writes them to a byte memory range, advances the position within the Brotli stream by the number of bytes read, and monitors cancellation requests.</summary>
<returns>A task that represents the asynchronous read operation, which wraps the total number of bytes read into the buffer. The result value can be less than the number of bytes allocated in the buffer if that many bytes are not currently available, or it can be 0 (zero) if the end of the Brotli stream has been reached.</returns>
<remarks>
<para>The `ReadAsync` method enables you to perform resource-intensive I/O operations without blocking the main thread. This performance consideration is particularly important in a Windows 8.x Store app or desktop app where a time-consuming stream operation can block the UI thread and make your app appear as if it is not working. The async methods are used in conjunction with the <see langword="async" /> and <see langword="await" /> keywords in Visual Basic and C#.</para>
<para>The `ReadAsync` method enables you to perform resource-intensive I/O operations without blocking the main thread. This performance consideration is particularly important in a desktop app where a time-consuming stream operation can block the UI thread and make your app appear as if it is not working. The async methods are used in conjunction with the <see langword="async" /> and <see langword="await" /> keywords in Visual Basic and C#.</para>
<para>Use the <see cref="P:System.IO.Compression.BrotliStream.CanRead" /> property to determine whether the current instance supports reading.</para>
<para>If the operation is canceled before it completes, the returned task contains the <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="P:System.Threading.Tasks.Task.Status" /> property.</para>
</remarks>
Expand Down Expand Up @@ -964,7 +964,7 @@
<summary>Asynchronously reads a sequence of bytes from the current Brotli stream, writes them to a byte array starting at a specified index, advances the position within the Brotli stream by the number of bytes read, and monitors cancellation requests.</summary>
<returns>A task that represents the asynchronous read operation, which wraps the total number of bytes read into the <paramref name="buffer" />. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the Brotli stream has been reached.</returns>
<remarks>
<para>The `ReadAsync` method enables you to perform resource-intensive I/O operations without blocking the main thread. This performance consideration is particularly important in a Windows 8.x Store app or desktop app where a time-consuming stream operation can block the UI thread and make your app appear as if it is not working. The async methods are used in conjunction with the <see langword="async" /> and <see langword="await" /> keywords in Visual Basic and C#.</para>
<para>The `ReadAsync` method enables you to perform resource-intensive I/O operations without blocking the main thread. This performance consideration is particularly important in a desktop app where a time-consuming stream operation can block the UI thread and make your app appear as if it is not working. The async methods are used in conjunction with the <see langword="async" /> and <see langword="await" /> keywords in Visual Basic and C#.</para>
<para>Use the <see cref="P:System.IO.Compression.BrotliStream.CanRead" /> property to determine whether the current instance supports reading.</para>
<para>If the operation is canceled before it completes, the returned task contains the <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="P:System.Threading.Tasks.Task.Status" /> property.</para>
<para>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:System.IO.Compression.BrotliStream.Read(System.Byte[],System.Int32,System.Int32)" />.</para>
Expand Down Expand Up @@ -1198,7 +1198,7 @@
<summary>Asynchronously writes compressed bytes to the underlying Brotli stream from the specified byte memory range.</summary>
<returns>A task that represents the asynchronous write operation.</returns>
<remarks>
<para>The `WriteAsync` method enables you to perform resource-intensive I/O operations without blocking the main thread. This performance consideration is particularly important in a Windows 8.x Store app or desktop app where a time-consuming stream operation can block the UI thread and make your app appear as if it is not working. The async methods are used in conjunction with the <see langword="async" /> and <see langword="await" /> keywords in Visual Basic and C#.</para>
<para>The `WriteAsync` method enables you to perform resource-intensive I/O operations without blocking the main thread. This performance consideration is particularly important in a desktop app where a time-consuming stream operation can block the UI thread and make your app appear as if it is not working. The async methods are used in conjunction with the <see langword="async" /> and <see langword="await" /> keywords in Visual Basic and C#.</para>
<para>Use the <see cref="P:System.IO.Compression.BrotliStream.CanWrite" /> property to determine whether the current instance supports writing.</para>
<para>If the operation is canceled before it completes, the returned task contains the <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="P:System.Threading.Tasks.Task.Status" /> property.</para>
</remarks>
Expand Down Expand Up @@ -1246,7 +1246,7 @@
<summary>Asynchronously writes compressed bytes to the underlying Brotli stream from the specified byte array.</summary>
<returns>A task that represents the asynchronous write operation.</returns>
<remarks>
<para>The `WriteAsync` method enables you to perform resource-intensive I/O operations without blocking the main thread. This performance consideration is particularly important in a Windows 8.x Store app or desktop app where a time-consuming stream operation can block the UI thread and make your app appear as if it is not working. The async methods are used in conjunction with the <see langword="async" /> and <see langword="await" /> keywords in Visual Basic and C#.</para>
<para>The `WriteAsync` method enables you to perform resource-intensive I/O operations without blocking the main thread. This performance consideration is particularly important in a desktop app where a time-consuming stream operation can block the UI thread and make your app appear as if it is not working. The async methods are used in conjunction with the <see langword="async" /> and <see langword="await" /> keywords in Visual Basic and C#.</para>
<para>Use the <see cref="P:System.IO.Compression.BrotliStream.CanWrite" /> property to determine whether the current instance supports writing.</para>
<para>If the operation is canceled before it completes, the returned task contains the <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="P:System.Threading.Tasks.Task.Status" /> property.</para>
<para>This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as <see cref="T:System.ArgumentException" />, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by <see cref="M:System.IO.Compression.BrotliStream.Write(System.Byte[],System.Int32,System.Int32)" />.</para>
Expand Down
12 changes: 6 additions & 6 deletions xml/System.IO.Compression/DeflateStream.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<remarks>
<format type="text/markdown"><![CDATA[

This class represents the Deflate algorithm, which is an industry-standard algorithm for lossless file compression and decompression. Starting with .NET Framework 4.5, the <xref:System.IO.Compression.DeflateStream> class uses the zlib library. As a result, it provides a better compression algorithm and, in most cases, a smaller compressed file than it provides in earlier versions of .NET Framework.
This class represents the Deflate algorithm, which is an industry-standard algorithm for lossless file compression and decompression. This class uses the zlib library for compression.

This class does not inherently provide functionality for adding files to or extracting files from zip archives. To work with zip archives, use the <xref:System.IO.Compression.ZipArchive> and the <xref:System.IO.Compression.ZipArchiveEntry> classes.

Expand Down Expand Up @@ -480,9 +480,9 @@ You use this constructor when you want to specify whether compression efficiency
<format type="text/markdown"><![CDATA[

> [!IMPORTANT]
> Starting in .NET 6, this method might not read as many bytes as were requested. For more information, see [Partial and zero-byte reads in DeflateStream, GZipStream, and CryptoStream](/dotnet/core/compatibility/core-libraries/6.0/partial-byte-reads-in-streams).
> This method might not read as many bytes as were requested. For more information, see [Partial and zero-byte reads in DeflateStream, GZipStream, and CryptoStream](/dotnet/core/compatibility/core-libraries/6.0/partial-byte-reads-in-streams).

Starting with .NET Framework 4.5, you can perform asynchronous read operations by using the <xref:System.IO.Stream.ReadAsync*> method. The <xref:System.IO.Compression.DeflateStream.BeginRead*> method is still available in current versions to support legacy code; however, you can implement asynchronous I/O operations more easily by using the new async methods. For more information, see [Asynchronous File I/O](/dotnet/standard/io/asynchronous-file-i-o).
This method is available to support legacy code; however, you can implement asynchronous I/O operations more easily by using the newer async methods such as <xref:System.IO.Stream.ReadAsync*>. For more information, see [Asynchronous File I/O](/dotnet/standard/io/asynchronous-file-i-o).
Comment on lines 482 to +485

Pass the <xref:System.IAsyncResult> return value to the <xref:System.IO.Compression.DeflateStream.EndRead*> method of the stream to determine how many bytes were read and to release operating system resources used for reading. You can do this either by using the same code that called <xref:System.IO.Compression.DeflateStream.BeginRead*> or in a callback passed to <xref:System.IO.Compression.DeflateStream.BeginRead*>.

Expand Down Expand Up @@ -578,7 +578,7 @@ If a stream is closed or you pass an invalid argument, exceptions are thrown imm
<remarks>
<format type="text/markdown"><![CDATA[

Starting with .NET Framework 4.5, you can perform asynchronous write operations by using the <xref:System.IO.Stream.WriteAsync*> method. The <xref:System.IO.Compression.DeflateStream.BeginWrite*> method is still available in current versions to support legacy code; however, you can implement asynchronous I/O operations more easily by using the new async methods. For more information, see [Asynchronous File I/O](/dotnet/standard/io/asynchronous-file-i-o).
This method is available to support legacy code; however, you can implement asynchronous I/O operations more easily by using the newer async methods such as <xref:System.IO.Stream.WriteAsync*>. For more information, see [Asynchronous File I/O](/dotnet/standard/io/asynchronous-file-i-o).

Pass the <xref:System.IAsyncResult> object returned by the current method to <xref:System.IO.Compression.DeflateStream.EndWrite*> to ensure that the write completes and frees resources appropriately. You can do this either by using the same code that called <xref:System.IO.Compression.DeflateStream.BeginWrite*> or in a callback passed to <xref:System.IO.Compression.DeflateStream.BeginWrite*>. If an error occurs during an asynchronous write operation, an exception will not be thrown until <xref:System.IO.Compression.DeflateStream.EndWrite*> is called with the <xref:System.IAsyncResult> returned by this method.

Expand Down Expand Up @@ -985,7 +985,7 @@ Calling `DisposeAsync` allows the resources used by the <xref:System.IO.Compress

## Remarks

Starting with .NET Framework 4.5, you can perform asynchronous read operations by using the <xref:System.IO.Stream.ReadAsync*> method. The <xref:System.IO.Compression.DeflateStream.EndRead*> method is still available in current versions to support legacy code; however, you can implement asynchronous I/O operations more easily by using the new async methods. For more information, see [Asynchronous File I/O](/dotnet/standard/io/asynchronous-file-i-o).
This method is available to support legacy code; however, you can implement asynchronous I/O operations more easily by using the newer async methods such as <xref:System.IO.Stream.ReadAsync*>. For more information, see [Asynchronous File I/O](/dotnet/standard/io/asynchronous-file-i-o).

Call this method to determine how many bytes were read from the stream. This method can be called once to return the amount of bytes read between calls to <xref:System.IO.Compression.DeflateStream.BeginRead*> and <xref:System.IO.Compression.DeflateStream.EndRead*>.

Expand Down Expand Up @@ -1051,7 +1051,7 @@ The stream is <see langword="null" />.</exception>

## Remarks

Starting with .NET Framework 4.5, you can perform asynchronous write operations by using the <xref:System.IO.Stream.WriteAsync*> method. The <xref:System.IO.Compression.DeflateStream.EndWrite*> method is still available in current versions to support legacy code; however, you can implement asynchronous I/O operations more easily by using the new async methods. For more information, see [Asynchronous File I/O](/dotnet/standard/io/asynchronous-file-i-o).
This method is available to support legacy code; however, you can implement asynchronous I/O operations more easily by using the newer async methods such as <xref:System.IO.Stream.WriteAsync*>. For more information, see [Asynchronous File I/O](/dotnet/standard/io/asynchronous-file-i-o).

<xref:System.IO.Compression.DeflateStream.EndWrite*> must be called only once for every call to the <xref:System.IO.Compression.DeflateStream.BeginWrite*> method.

Expand Down
Loading
Loading