SnappyArchive.SnappyArchive
Contents
[
Hide
]SnappyArchive()
Initializes a new instance of the SnappyArchive
class prepared for compressing.
public SnappyArchive()
Examples
The following example shows how to compress a file.
using (SnappyArchive archive = new SnappyArchive())
{
archive.SetSource("data.bin");
archive.Save("archive.snappy");
}
See Also
- class SnappyArchive
- namespace Aspose.Zip.Snappy
- assembly Aspose.Zip
SnappyArchive(Stream)
Initializes a new instance of the SnappyArchive
class prepared for decompressing.
public SnappyArchive(Stream source)
Parameter | Type | Description |
---|---|---|
source | Stream | The source of the archive. |
Exceptions
exception | condition |
---|---|
ArgumentException | source is not seekable. |
ArgumentNullException | source is null. |
Remarks
This constructor does not decompress. See Extract
method for decompressing.
See Also
- class SnappyArchive
- namespace Aspose.Zip.Snappy
- assembly Aspose.Zip
SnappyArchive(string)
Initializes a new instance of the SnappyArchive
class prepared for decompressing.
public SnappyArchive(string path)
Parameter | Type | Description |
---|---|---|
path | String | Path to the source of the archive. |
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. |
FileNotFoundException | The file is not found. |
DirectoryNotFoundException | The specified path is invalid, such as being on an unmapped drive. |
IOException | The file is already open. |
Remarks
This constructor does not decompress. See Extract
method for decompressing.
Examples
using (FileStream extractedFile = File.Open(extractedFileName, FileMode.Create))
{
using (var archive = new SnappyArchive(sourceSnappyFile))
{
archive.Extract(extractedFile);
}
}
See Also
- class SnappyArchive
- namespace Aspose.Zip.Snappy
- assembly Aspose.Zip