Class ArjEntryPlain
Namespace: Aspose.Zip.Arj
Assembly: Aspose.Zip.dll (25.2.0)
Represents single file within ARJ archive.
public class ArjEntryPlain : IArchiveFileEntry
Inheritance
Implements
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Properties
CompressedSize
Gets size of compressed file.
public uint CompressedSize { get; }
Property Value
Name
Gets name of the entry within archive.
public string Name { get; }
Property Value
UncompressedSize
Gets size of original file.
public uint UncompressedSize { get; }
Property Value
Methods
Extract(string)
Extracts the entry to the filesystem by the path provided.
public FileInfo Extract(string path)
Parameters
path
string
The path to destination file. If the file already exists, it will be overwritten.
Returns
The file info of composed file.
Examples
Extract two entries of rar archive.
using (FileStream arjFile = File.Open("archive.arj", FileMode.Open))
{
using (ArjArchive archive = new ArjArchive(arjFile))
{
archive.Entries[0].Extract("first.bin");
archive.Entries[1].Extract("second.bin");
}
}
Exceptions
path
is null or empty.
Extract(FileInfo)
Extracts ARJ archive entry to a file.
public void Extract(FileInfo fileInfo)
Parameters
fileInfo
FileInfo
FileInfo for storing decompressed data.
Examples
using (var arjFile = File.Open(sourceFileName, FileMode.Open))
{
using (var archive = new ArjArchive(arjFile))
{
archive.Entries[0].Extract(new FileInfo("extracted.bin"));
}
}
Exceptions
Archive headers and service information were not read.
The caller does not have the required permission to open the fileInfo
.
File path is empty or contains only white spaces.
The file is not found.
Path to file is read-only or is a directory.
fileInfo
is null.
The specified path is invalid, such as being on an unmapped drive.
The file is already open.
Extract(Stream)
Extracts the entry to the stream provided.
public void Extract(Stream destination)
Parameters
destination
Stream
Destination stream. Must be writable.
Exceptions
destination
does not support writing.
Checksum mismatch for headers or data. - or - Archive is corrupted.
Entry compressed with method 4.