Skip to main content

ZipArchive.Read(Stream, Encoding, Boolean) Method

Static method that creates a ZipArchive instance from the specified stream containing zipped data, use the specified encoding for the zip item names and allows you not to catch exceptions when extracting a particular zip entry.

Namespace: DevExpress.Compression

Assembly: DevExpress.Docs.v24.1.dll

NuGet Package: DevExpress.Document.Processor

Declaration

public static ZipArchive Read(
    Stream stream,
    Encoding encoding,
    bool catchExceptions
)

Parameters

Name Type Description
stream Stream

A Stream object that is the stream containing archive data.

encoding Encoding

The Encoding object that specifies character encoding for the zip item names.

catchExceptions Boolean

True to catch exceptions when extracting a particular zip entry and skip the problematic entry; otherwise, false.

Returns

Type Description
ZipArchive

A ZipArchive instance that is the zip archive for modification or extraction.

Remarks

The Read method override allows you not to skip problematic zip entries during archive extraction (default behavior), but to throw exceptions so they propagate up the call chain.

Note

If you handle the ZipArchive.Error event, in the problematic situation the event occurs and subsequently the exception is thrown.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Read(Stream, Encoding, Boolean) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also