Xceed Real-Time Zip for .NET Documentation
XceedCompressedStream Constructor(Stream,CompressionMethod,CompressionLevel,Boolean)


Xceed.Compression.Formats Assembly > Xceed.Compression.Formats Namespace > XceedCompressedStream Class > XceedCompressedStream Constructor : XceedCompressedStream Constructor(Stream,CompressionMethod,CompressionLevel,Boolean)
The stream to write to and read from.
A Xceed.Compression.CompressionMethod value representing the compression method to use.
A Xceed.Compression.CompressionLevel value representing the compression level to use.
If true, this stream can only be read from and the header will be read immediately. If false, this stream can be used for reading or writing but no header is read until a call to FormattedCompressedStream.Write or FormattedCompressedStream.Read.
Initializes a new instance of the XceedCompressedStream class specifying the inner stream to write to and read from, the compression method and level to use.
Syntax
'Declaration
 
Public Function New( _

   ByVal inner As Stream, _

   ByVal method As CompressionMethod, _

   ByVal level As CompressionLevel, _

   ByVal readHeader As Boolean _

)
'Usage
 
Dim inner As Stream

Dim method As CompressionMethod

Dim level As CompressionLevel

Dim readHeader As Boolean

 

Dim instance As New XceedCompressedStream(inner, method, level, readHeader)
public XceedCompressedStream( 

   Stream inner,

   CompressionMethod method,

   CompressionLevel level,

   bool readHeader

)

Parameters

inner
The stream to write to and read from.
method
A Xceed.Compression.CompressionMethod value representing the compression method to use.
level
A Xceed.Compression.CompressionLevel value representing the compression level to use.
readHeader
If true, this stream can only be read from and the header will be read immediately. If false, this stream can be used for reading or writing but no header is read until a call to FormattedCompressedStream.Write or FormattedCompressedStream.Read.
Remarks

If the inner stream is readonly, the compressed stream will read the header at construction.

The Stored compression method is not supported. The compression level only applies to the Deflated and Deflated64 compression methods.  It does not apply to the BZip2, BWT, or PPMd compression methods.

The PPMd algorithm uses a custom memory management system called SubAllocator. In a zip file, the memory size the SubAllocator uses is defined in the WinZip PPMd header for the compressed file and this header's value is used when decompressing the data. In general, WinZip uses 64Mb. Since the algorithm used was not optimized from the original PPMd version I revision 1, the SubAllocator initially requires the total amount of memory specified in the PPMd compressor. This means you must have at least 64 free Mb of RAM when using this compression method.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

XceedCompressedStream Class
XceedCompressedStream Members
Overload List