Class ArjArchive
Namespace: Aspose.Zip.Arj
Assembly: Aspose.Zip.dll (25.2.0)
This class represents ARJ archive file.
public class ArjArchive : IArchive, IDisposable
Inheritance
Implements
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Only 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)
Initializes a new instance of the Aspose.Zip.Arj.ArjArchive class and composes entries list can be extracted from the archive.
public ArjArchive(Stream extractionSource)
Parameters
extractionSource
Stream
The source of the archive.
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.
Archive is garbled.
ArjArchive(string)
Initializes a new instance of the Aspose.Zip.Arj.ArjArchive class and composes entries list can be extracted from the archive.
public ArjArchive(string path)
Parameters
path
string
The path to the archive file.
Examples
The following example shows how to extract all of 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
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
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.