Export (0) Print
Expand All

DeflateStream.EndWrite Method

Ends an asynchronous write operation.

Namespace: System.IO.Compression
Assembly: System (in system.dll)

public override void EndWrite (
	IAsyncResult asyncResult
)
public void EndWrite (
	IAsyncResult asyncResult
)
public override function EndWrite (
	asyncResult : IAsyncResult
)
Not applicable.

Parameters

asyncResult

A reference to the outstanding asynchronous I/O request.

Exception typeCondition

ArgumentNullException

asyncResult is a null reference (Nothing in Visual Basic).

ArgumentException

asyncResult did not originate from a BeginWrite method on the current stream.

Exception

An exception was thrown during a call to WaitOne.

InvalidOperationException

The stream is a null reference (Nothing in Visual Basic).

InvalidOperationException

The end write call is invalid.

EndWrite must be called only once for every call to the BeginWrite method.

This method blocks until the I/O operation has completed. Errors that occur during an asynchronous write request, such as a disk failure during the I/O request, occur on the thread pool thread and become visible upon a call to EndWrite. Exceptions thrown by the thread pool thread will not be visible when calling EndWrite.

The following code example shows how to use the DeflateStream class to compress and decompress a file.

IO.Compression.Deflate1#1

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft