public virtual void Save(string fullPath) { var tempFullPath = fullPath + ".temp"; using (var fs = new FileStream(tempFullPath, FileMode.Create, FileAccess.Write)) using (var zip = new GZipStream(fs, CompressionMode.Compress, false)) using (var buff = new BufferedStream(zip, 8192)) using (var bw = new BinaryWriter(buff, Encoding.UTF8)) { bw.Write((byte)0);//version Audios.Store(bw); } if (File.Exists(fullPath)) { File.Delete(fullPath); } File.Move(tempFullPath, fullPath); }
public DB() { Audios = new Audios(); }