public static Create ( Stream outStream ) : |
||
outStream | Stream | The stream providing data storage. |
Результат |
ZipFile(string filename, IReadWritePackage parent) { pkgStream = new MemoryStream(); Name = filename; Parent = parent; pkg = SZipFile.Create(pkgStream); }
public ZipFile(IReadOnlyFileSystem context, string filename, bool createOrClearContents = false) { Name = filename; if (createOrClearContents) { pkg = SZipFile.Create(filename); } else { pkg = new SZipFile(filename); } }
public ZipFile(FileSystem context, string filename, Stream stream, bool createOrClearContents = false) { Name = filename; if (createOrClearContents) { pkg = SZipFile.Create(stream); } else { pkg = new SZipFile(stream); } }
// Create a new zip with the specified contents public ZipFile(string filename, int priority, Dictionary <string, byte[]> contents) { this.priority = priority; this.filename = filename; if (File.Exists(filename)) { File.Delete(filename); } pkg = SZipFile.Create(filename); Write(contents); }
public void Write(Dictionary <string, byte[]> contents) { // TODO: Clear existing content? pkg.Close(); pkg = SZipFile.Create(filename); pkg.BeginUpdate(); foreach (var kvp in contents) { pkg.Add(new StaticMemoryDataSource(kvp.Value), kvp.Key); } pkg.CommitUpdate(); pkg.Close(); pkg = new SZipFile(new MemoryStream(File.ReadAllBytes(filename))); }