ZstandardArchive.ZstandardArchive
Contents
[
Hide
]ZstandardArchive()
Initializes a new instance of the ZstandardArchive
class prepared for compressing.
public ZstandardArchive()
Examples
The following example shows how to compress a file.
using (ZstandardArchive archive = new ZstandardArchive())
{
archive.SetSource("data.bin");
archive.Save("archive.zst");
}
See Also
- class ZstandardArchive
- namespace Aspose.Zip.Zstandard
- assembly Aspose.Zip
ZstandardArchive(Stream, ZstandardLoadOptions)
Initializes a new instance of the ZstandardArchive
class prepared for decompressing.
public ZstandardArchive(Stream sourceStream, ZstandardLoadOptions options = null)
Parameter | Type | Description |
---|---|---|
sourceStream | Stream | The source of the archive. |
options | ZstandardLoadOptions | The options to load archive with. |
Remarks
This constructor does not decompress. See Open
method for decompressing.
Examples
Open an archive from a stream and extract it to a MemoryStream
var ms = new MemoryStream();
using (GzipArchive archive = new ZstandardArchive(File.OpenRead("archive.zst")))
archive.Open().CopyTo(ms);
See Also
- class ZstandardLoadOptions
- class ZstandardArchive
- namespace Aspose.Zip.Zstandard
- assembly Aspose.Zip
ZstandardArchive(string, ZstandardLoadOptions)
Initializes a new instance of the ZstandardArchive
class.
public ZstandardArchive(string path, ZstandardLoadOptions options = null)
Parameter | Type | Description |
---|---|---|
path | String | The path to the archive file. |
options | ZstandardLoadOptions | The options to load archive with. |
Exceptions
exception | condition |
---|---|
ArgumentNullException | path is null. |
SecurityException | The caller does not have the required permission to access. |
ArgumentException | The path is empty, contains only white spaces, or contains invalid characters. |
UnauthorizedAccessException | Access to file path is denied. |
PathTooLongException | The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. |
NotSupportedException | File at path contains a colon (:) in the middle of the string. |
Remarks
This constructor does not decompress. See Open
method for decompressing.
Examples
Open an archive from file by path and extract it to a MemoryStream
var ms = new MemoryStream();
using (ZstandardArchive archive = new ZstandardArchive("archive.zst"))
archive.Open().CopyTo(ms);
See Also
- class ZstandardLoadOptions
- class ZstandardArchive
- namespace Aspose.Zip.Zstandard
- assembly Aspose.Zip