C# Класс StreamUnpack, extensions

Provides unpacking behavior for steams are OPC (Open Packaging Convention) packages/zips.
Показать файл Открыть проект

Открытые методы

Метод Описание
Unpack ( this zipStream, string fileToUnpack, Stream unpacked ) : bool

From the given stream, unzips the file with the given name onto the given unpacked stream.

If the fileToUnpack is not found, nothing gets written to unpacked.

Unpack ( this zipStream, string targetDir ) : void

Unzips the given stream onto the target directory.

If the targetDir already exists, it's deleted before unzipping begins to ensure a clean destination folder.

The compressed stream must be a proper Package in term of XPS/OPC (at a minimum, have a [Content_Types].xml).

Приватные методы

Метод Описание
BuildTargetFileName ( string baseDir, Uri partUri ) : string
GetFileName ( string uri ) : string
ShouldUnpack ( string filePath, string filesToUnpack ) : bool

Описание методов

Unpack() публичный статический Метод

From the given stream, unzips the file with the given name onto the given unpacked stream.
If the fileToUnpack is not found, nothing gets written to unpacked.
public static Unpack ( this zipStream, string fileToUnpack, Stream unpacked ) : bool
zipStream this The stream to unpack
fileToUnpack string The file inside te pack to unpack
unpacked Stream The stream where the file will be unpacked
Результат bool

Unpack() публичный статический Метод

Unzips the given stream onto the target directory.
If the targetDir already exists, it's deleted before unzipping begins to ensure a clean destination folder.

The compressed stream must be a proper Package in term of XPS/OPC (at a minimum, have a [Content_Types].xml).

public static Unpack ( this zipStream, string targetDir ) : void
zipStream this The stream to unpack
targetDir string The target directory where stream will be unpacked
Результат void