MobileForms Toolkit Documentation

ZipStream  Constructor (Stream, String, ZipStreamMode, Int32, String, Int32, Boolean, Int32)

Initializes a new instance of the ZipStream class with specified underlaying stream, name, read/write mode, compression level and password.

public ZipStream(
Stream stream,
string name,
ZipStreamMode mode,
int level,
string password,
int cryptSeed,
bool useCrc,
int bufferSize
);

Parameters

stream
The main stream.
name
Name of new stream.
mode
A ZipStreamMode constant that determines how the stream can be accessed.
level
Compression level between 0 and 9.
password
A password used for encryption/decryption.
cryptSeed
Seed used for detection of valid password
useCrc
Specifies if stream will compute CRC.
bufferSize
Size of the stream buffer. Default is DefaultBufferSize.

Remarks

This method uses password to initialize encryption/decryption header and uses specified compresion level. In this contructor you can specify also crypt seed, which is used to check for valid password. If this value is default (-1), as in constructor without this parameter, as a seed is used CRC of password. Its something like password pair. If you crypt stream with password and seed, to decrypt it you need specify both; password and seed. In standart zip archives is used as seed CRC or date of the file. Disabling of computing CRC can speed up compression or decempression.

See Also

ZipStream Class | Resco.IO.Zip Namespace | ZipStream Constructor Overload List