Lz4Archive.Extract

Extract(string)

Extracts the archive to the file by path.

public FileInfo Extract(string path)
ParameterTypeDescription
pathStringThe path to destination file. If the file already exists, it will be overwritten.

Return Value

Info of an extracted file.

Exceptions

exceptioncondition
EndOfStreamExceptionSource stream is too short.
InvalidDataExceptionWrong bytes found while decoding.
NotSupportedExceptionThis LZ4 version is not supported.
OperationCanceledExceptionIn .NET Framework 4.0 and above: Thrown when the extraction is canceled via the provided cancellation token.
ObjectDisposedExceptionArchive has been disposed and cannot be used.

See Also


Extract(Stream)

Extracts the archive to the stream provided.

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

Exceptions

exceptioncondition
ArgumentExceptiondestination does not support writing.
EndOfStreamExceptionSource stream is too short.
InvalidDataExceptionWrong bytes found while decoding.
NotSupportedExceptionThis LZ4 version is not supported.
InvalidOperationExceptionThe archive is prepared for composition.
OperationCanceledExceptionIn .NET Framework 4.0 and above: Thrown when the extraction is canceled via the provided cancellation token.
ObjectDisposedExceptionArchive has been disposed and cannot be used.

Examples

using (var archive = new Lz4Archive("archive.lz4"))
{
     archive.Extract(httpResponseStream);
}

See Also