System.IO.Compression.GZipStream.EndRead Method

Waits for the pending asynchronous read to complete. (Consider using the the System.IO.Stream.ReadAsync(Byte[], int, int) method instead; see the Remarks section.)

Syntax

public override int EndRead (IAsyncResult async_result)

Parameters

async_result
Documentation for this section has not yet been entered.

Returns

The number of bytes read from the stream, between 0 (zero) and the number of bytes you requested. System.IO.Compression.GZipStream returns 0 only at the end of the stream; otherwise, it blocks until at least one byte is available.

Remarks

Starting with the net_v45, you can perform asynchronous read operations by using the System.IO.Stream.ReadAsync(Byte[], int, int) method. The GZipStream.EndRead(IAsyncResult) method is still available in net_v45 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.

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 GZipStream.BeginRead(Byte[], int, int, AsyncCallback, object) and GZipStream.EndRead(IAsyncResult).

This method blocks until the I/O operation has completed.

Requirements

Namespace: System.IO.Compression
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0