GZipStream::Write Method (array<Byte>^, Int32, Int32)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Writes compressed bytes to the underlying stream from the specified byte array.

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

virtual void Write(
	array<unsigned char>^ array,
	int offset,
	int count
) override


Type: array<System::Byte>^

The buffer that contains the data to compress.

Type: System::Int32

The byte offset in array from which the bytes will be read.

Type: System::Int32

The maximum number of bytes to write.

Exception Condition

The write operation cannot be performed because the stream is closed.

The write operation might not occur immediately but is buffered until the buffer size is reached or until the Flush or Close method is called.

The following example shows how to compress and decompress bytes by using the Read and Write methods.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top