IsoArchive.IsoArchive

IsoArchive()

Initializes a new instance of the IsoArchive class and creates an empty ISO archive for adding new files and directories.

public IsoArchive()

Examples

The following example shows how to create a new empty ISO archive and add files to it:

// Create a new empty ISO archive
using(IsoArchive isoArchive = new IsoArchive())
{
    // Add files to the ISO archive
    isoArchive.CreateEntry("example_file.txt", "path_to_file.txt");

    // Save the ISO archive to a file
    isoArchive.Save("new_archive.iso");
}

See Also


IsoArchive(Stream, IsoLoadOptions)

Initializes a new instance of the IsoArchive class and composes entries list that can be extracted from the archive.

public IsoArchive(Stream sourceStream, IsoLoadOptions loadOptions = null)
ParameterTypeDescription
sourceStreamStreamThe source of the archive. It must be seekable.
loadOptionsIsoLoadOptionsThe options to load archive with.

Exceptions

exceptioncondition
ArgumentNullExceptionsourceStream is null.
ArgumentExceptionsourceStream is not seekable.
InvalidDataExceptionsourceStream is not a valid ISO archive.

Remarks

This constructor does not unpack any entry.

Examples

The following example shows how to extract all of the entries to a directory.

using (var archive = new IsoArchive(File.OpenRead("archive.iso")))
{ 
   archive.ExtractToDirectory("C:\\extracted");
}

See Also


IsoArchive(string, IsoLoadOptions)

Initializes a new instance of the IsoArchive class and composes entries list that can be extracted from the archive.

public IsoArchive(string path, IsoLoadOptions loadOptions = null)
ParameterTypeDescription
pathStringThe path to the archive file.
loadOptionsIsoLoadOptionsThe options to load archive with.

Exceptions

exceptioncondition
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.
FileNotFoundExceptionThe file is not found.
DirectoryNotFoundExceptionThe specified path is invalid, such as being on an unmapped drive.
IOExceptionThe file is already open.
EndOfStreamExceptionFile is too short.

Remarks

This constructor does not unpack any entry.

Examples

The following example shows how to extract all of the entries to a directory.

using (var archive = new IsoArchive("archive.iso")) 
{ 
   archive.ExtractToDirectory("C:\\extracted");
}

See Also