LzmaArchive.Save
Save(Stream)
Saves lzma archive to the stream provided.
public void Save(Stream output)
Parameter | Type | Description |
---|
output | Stream | Destination stream. |
Exceptions
exception | condition |
---|
ArgumentException | output does not support seeking. |
ArgumentNullException | output is null. |
output must be seekable.
Examples
using (FileStream lzmaFile = File.Open("archive.lzma", FileMode.Create))
{
using (var archive = new LzmaArchive())
{
archive.SetSource("data.bin");
archive.Save(lzmaFile);
}
}
See Also
Save(FileInfo)
Saves lzma archive to destination file provided.
public void Save(FileInfo destination)
Parameter | Type | Description |
---|
destination | FileInfo | FileInfo which will be opened as destination stream. |
Exceptions
exception | condition |
---|
SecurityException | The caller does not have the required permission to open the destination. |
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 | destination is null. |
DirectoryNotFoundException | The specified path is invalid, such as being on an unmapped drive. |
IOException | The file is already open. |
Examples
using (var archive = new LzmaArchive())
{
archive.SetSource(new FileInfo("data.bin"));
archive.Save(new FileInfo("archive.lzma"));
}
See Also
Save(string)
Saves lzma archive to destination file provided.
public void Save(string destinationFileName)
Parameter | Type | Description |
---|
destinationFileName | String | The path of the archive to be created. If the specified file name points to an existing file, it will be overwritten. |
Exceptions
exception | condition |
---|
ArgumentNullException | destinationFileName is null. |
SecurityException | The caller does not have the required permission to access. |
ArgumentException | The destinationFileName is empty, contains only white spaces, or contains invalid characters. |
UnauthorizedAccessException | Access to file destinationFileName is denied. |
PathTooLongException | The specified destinationFileName, 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. |
NotSupportedException | File at destinationFileName contains a colon (:) in the middle of the string. |
Examples
using (var archive = new LzmaArchive())
{
archive.SetSource(new FileInfo("data.bin"));
archive.Save("result.lzma");
}
See Also