TarArchive.FromGZip

FromGZip(Stream)

Extracts supplied gzip archive and composes TarArchive from extracted data.

Important: gzip archive is fully extracted within this method, its content is kept internally. Beware of memory consumption.

public static TarArchive FromGZip(Stream source)
ParameterTypeDescription
sourceStreamThe source of the archive.

Return Value

An instance of TarArchive

Exceptions

exceptioncondition
InvalidDataExceptionThe archive is corrupted.

Remarks

GZip extraction stream is not seekable by the nature of compression algorithm. Tar archive provides facility to extract arbitrary record, so it has to operate seekable stream under the hood.

See Also


FromGZip(string)

Extracts supplied gzip archive and composes TarArchive from extracted data.

Important: gzip archive is fully extracted within this method, its content is kept internally. Beware of memory consumption.

public static TarArchive FromGZip(string path)
ParameterTypeDescription
pathStringThe path to the archive file.

Return Value

An instance of TarArchive

Exceptions

exceptioncondition
ArgumentNullExceptionpath is null.
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 is in an invalid format.
DirectoryNotFoundExceptionThe specified path is invalid, such as being on an unmapped drive.
FileNotFoundExceptionThe file is not found.
InvalidDataExceptionThe archive is corrupted.

Remarks

GZip extraction stream is not seekable by the nature of compression algorithm. Tar archive provides facility to extract arbitrary record, so it has to operate seekable stream under the hood.

See Also