LzxArchiveEntry.Extract

Extract(string)

Extracts Lzx archive entry to a filesystem by path.

public FileSystemInfo Extract(string path)
ParameterTypeDescription
pathStringPath to file which will store decompressed data.

Return Value

FileSystemInfoInstance containing extracted data.

Exceptions

exceptioncondition
InvalidOperationExceptionArchive headers and service information were not read.
ArgumentNullExceptionpath is null.
SecurityExceptionThe caller does not have the required permission to access.
ArgumentExceptionThe path is empty, contains only white spaces, or contains invalid characters.
UnauthorizedAccessExceptionAccess to file path is denied.
PathTooLongExceptionThe 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.
NotSupportedExceptionFile at path contains a colon (:) in the middle of the string.
InvalidDataExceptionChecksum mismatch for headers or data. - or - Archive is corrupted.
OperationCanceledExceptionIn .NET Framework 4.0 and above: Thrown when the extraction is canceled via the provided cancellation token.
NotSupportedExceptionInvalid compression method.

Examples

using (FileStream lzxFile = File.Open(sourceFileName, FileMode.Open))
{
    using (var archive = new LzxArchive(lhaFile))
    {
        archive.Entries[0].Extract("extracted.bin");
    }
}

See Also


Extract(Stream)

Extracts the entry to the stream provided.

public void Extract(Stream destination)
ParameterTypeDescription
destinationStreamDestination stream. Must be writable.

Exceptions

exceptioncondition
ArgumentExceptiondestination does not support writing.
InvalidDataExceptionChecksum mismatch for headers or data. - or - Archive is corrupted.
ArgumentNullExceptionDestination stream is null.
NotSupportedExceptionInvalid compression method.
OperationCanceledExceptionIn .NET Framework 4.0 and above: Thrown when the extraction is canceled via the provided cancellation token.

See Also