IdeaBlade DevForce 2010 Help Reference
GZipStream Constructor(Stream,CompressionMode,Boolean)
See Also  Send Feedback
IdeaBlade.Core Assembly > Ionic.Zlib Namespace > GZipStream Class > GZipStream Constructor : GZipStream Constructor(Stream,CompressionMode,Boolean)



stream
The stream which will be read or written. This is called the "captive" stream in other places in this documentation.
mode
Indicates whether the GZipStream will compress or decompress.
leaveOpen
true if the application would like the base stream to remain open after inflation/deflation.
Create a GZipStream using the specified CompressionMode, and explicitly specify whether the stream should be left open after Deflation or Inflation.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal stream As Stream, _
   ByVal mode As CompressionMode, _
   ByVal leaveOpen As Boolean _
)
Visual Basic (Usage)Copy Code
Dim stream As Stream
Dim mode As CompressionMode
Dim leaveOpen As Boolean
 
Dim instance As New GZipStream(stream, mode, leaveOpen)
C# 
public GZipStream( 
   Stream stream,
   CompressionMode mode,
   bool leaveOpen
)
C++/CLI 
public:
GZipStream( 
   Stream^ stream,
   CompressionMode mode,
   bool leaveOpen
)

Parameters

stream
The stream which will be read or written. This is called the "captive" stream in other places in this documentation.
mode
Indicates whether the GZipStream will compress or decompress.
leaveOpen
true if the application would like the base stream to remain open after inflation/deflation.

Remarks

This constructor allows the application to request that the captive stream remain open after the deflation or inflation occurs. By default, after Close() is called on the stream, the captive stream is also closed. In some cases this is not desired, for example if the stream is a memory stream that will be re-read after compressed data has been written to it. Specify true for the leaveOpen parameter to leave the stream open.

The CompressionMode (Compress or Decompress) also establishes the "direction" of the stream. A GZipStream with CompressionMode.Compress works only through Write(). A GZipStream with CompressionMode.Decompress works only through Read().

The GZipStream will use the default compression level. If you want to specify the compression level, see GZipStream Constructor(Stream,CompressionMode,CompressionLevel,Boolean).

See the other overloads of this constructor for example code.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.