Class ArjEntryPlain

Class ArjEntryPlain

Namespace: Aspose.Zip.Arj
Assembly: Aspose.Zip.dll (25.2.0)

Represents single file within ARJ archive.

public class ArjEntryPlain : IArchiveFileEntry

Inheritance

objectArjEntryPlain

Implements

IArchiveFileEntry

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

uint

Name

Gets name of the entry within archive.

public string Name { get; }

Property Value

string

UncompressedSize

Gets size of original file.

public uint UncompressedSize { get; }

Property Value

uint

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

FileInfo

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

ArgumentNullException

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

InvalidOperationException

Archive headers and service information were not read.

SecurityException

The caller does not have the required permission to open the fileInfo.

ArgumentException

File path is empty or contains only white spaces.

FileNotFoundException

The file is not found.

UnauthorizedAccessException

Path to file is read-only or is a directory.

ArgumentNullException

fileInfo is null.

DirectoryNotFoundException

The specified path is invalid, such as being on an unmapped drive.

IOException

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

ArgumentException

destination does not support writing.

InvalidDataException

Checksum mismatch for headers or data. - or - Archive is corrupted.

NotImplementedException

Entry compressed with method 4.

 English