Class ArjArchive
Namespace: Aspose.Zip.Arj
Assembly: Aspose.Zip.dll (25.8.0)
This class represents an ARJ archive file.
public class ArjArchive : IArchive, IDisposableInheritance
Implements
Inherited Members
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Remarks
Only the following compression methods are supported:
| Method | Explanation |
|---|---|
| 0 | Uncompressed |
| 1 | Combination of LZ77 and adaptive Huffman coding. Best ratio. |
| 2 | Combination of LZ77 and adaptive Huffman coding. |
| 3 | Combination of LZ77 and adaptive Huffman coding. Best speed. |
Constructors
ArjArchive(Stream, ArjLoadOptions)
Initializes a new instance of the Aspose.Zip.Arj.ArjArchive class and composes an entry list can be extracted from the archive.
public ArjArchive(Stream extractionSource, ArjLoadOptions loadOptions = null)Parameters
extractionSource Stream
The source of the archive.
loadOptions ArjLoadOptions
Options to load existing archive with.
Remarks
This constructor does not decompress any entry. See Aspose.Zip.Arj.ArjEntryPlain.Extract(System.IO.Stream) method for decompressing.
Exceptions
extractionSource is null.
>extractionSource does not support seeking.
Wrong signature for archive. - or - The file is not an ARJ archive.
The archive is garbled.
ArjArchive(string, ArjLoadOptions)
Initializes a new instance of the Aspose.Zip.Arj.ArjArchive class and composes an entry list can be extracted from the archive.
public ArjArchive(string path, ArjLoadOptions loadOptions = null)Parameters
path string
The path to the archive file.
loadOptions ArjLoadOptions
Options to load existing archive with.
Examples
The following example shows how to extract all the entries to a directory.
using (var archive = new ArjArchive("archive.arj"))
{
archive.ExtractToDirectory("C:\extracted");
}Remarks
This constructor does not unpack any entry. See Aspose.Zip.Arj.ArjEntryPlain.Extract(System.IO.Stream) method for decompressing.
Exceptions
path is null.
The caller does not have the required permission to access.
The path is empty, contains only white spaces, or contains invalid characters.
Access to file path is denied.
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.
File at path contains a colon (:) in the middle of the string.
The file is not found.
The specified path is invalid, such as being on an unmapped drive.
The file is already open.
Properties
Commentary
Gets the commentary.
public string Commentary { get; }Property Value
Exceptions
Archive has been disposed and cannot be used.
Entries
Gets entries of Aspose.Zip.Arj.ArjEntryPlain type constituting the ARJ archive.
public ReadOnlyCollection<arjentryplain> Entries { get; }Property Value
ReadOnlyCollection < ArjEntryPlain >
Name
Gets the original name.
public string Name { get; }Property Value
Exceptions
Archive has been disposed and cannot be used.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()ExtractToDirectory(string)
Extracts all entries to the specified directory.
public void ExtractToDirectory(string destinationDirectory)Parameters
destinationDirectory string
The directory to extract the entries to.
Examples
The following example shows how to extract all entries to a directory:
using (var archive = new ArjArchive(File.OpenRead("archive.arj")))
{
archive.ExtractToDirectory("C:\\extracted");
}Exceptions
Thrown when the destinationDirectory is null.
Archive has been disposed and cannot be used.
In .NET Framework 4.0 and above: Thrown when the extraction is canceled via the provided cancellation token.