XarArchive
Contents
[
Hide
]XarArchive constructor (1 of 3)
Initializes a new instance of the XarArchive
class.
public XarArchive(XarCompressionSettings defaultCompressionSettings = null)
Parameter | Type | Description |
---|---|---|
defaultCompressionSettings | XarCompressionSettings | The default compression settings, applyed to all entries of the archive. |
Examples
The following example shows how to compress a file.
using (var archive = new XarArchive())
{
archive.CreateEntry("first.bin", "data.bin");
archive.Save("archive.xar");
}
See Also
- class XarCompressionSettings
- class XarArchive
- namespace Aspose.Zip.Xar
- assembly Aspose.Zip
XarArchive constructor (2 of 3)
Initializes a new instance of the XarArchive
class and composes entries list can be extracted from the archive.
public XarArchive(Stream sourceStream)
Parameter | Type | Description |
---|---|---|
sourceStream | Stream | The source of the archive. It must be seekable. |
Exceptions
exception | condition |
---|---|
ArgumentNullException | sourceStream is null. |
ArgumentException | sourceStream is not seekable. |
InvalidDataException | sourceStream is not valid xar archive. |
Remarks
This constructor does not unpack any entry. See Open
method for unpacking.
Examples
The following example shows how to extract all of the entries to a directory.
using (var archive = new XarArchive(File.OpenRead("archive.xar")))
{
archive.ExtractToDirectory("C:\\extracted");
}
See Also
- class XarArchive
- namespace Aspose.Zip.Xar
- assembly Aspose.Zip
XarArchive constructor (3 of 3)
Initializes a new instance of the XarArchive
class and composes entries list can be extracted from the archive.
public XarArchive(string path)
Parameter | Type | Description |
---|---|---|
path | String | The path to the archive file. |
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. |
InvalidDataException | File at path is not valid xar archive. |
Remarks
This constructor does not unpack any entry. See Open
method for unpacking.
Examples
The following example shows how to extract all of the entries to a directory.
using (var archive = new XarArchive("archive.xar"))
{
archive.ExtractToDirectory("C:\\extracted");
}
See Also
- class XarArchive
- namespace Aspose.Zip.Xar
- assembly Aspose.Zip