Updated the wizard to allow GPGEncryption. Settings now reflect the actual paths required. Completely reworked the way differential updates are read and written, which gives a much cleaner code, a heavy performance boost and a highly reduced number of temporary files. Removed duplicated code for streamwrapping. Updated SharpZipLib to the latest release. Removed unused compression code. git-svn-id: https://duplicati.googlecode.com/svn/trunk@84 59da171f-624f-0410-aa54-27559c288bec
32 lines
932 B
C#
32 lines
932 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.IO;
|
|
|
|
namespace Duplicati.Library.Encryption
|
|
{
|
|
internal class CryptoStreamWrapper : Core.OverrideableStream
|
|
{
|
|
private bool m_hasFlushed = false;
|
|
|
|
/// <summary>
|
|
/// Wraps a crypto stream, ensuring that it is correctly disposed
|
|
/// </summary>
|
|
/// <param name="basestream">The stream to wrape</param>
|
|
public CryptoStreamWrapper(System.Security.Cryptography.CryptoStream basestream)
|
|
: base(basestream)
|
|
{
|
|
}
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (!m_hasFlushed && m_basestream.CanWrite)
|
|
{
|
|
((System.Security.Cryptography.CryptoStream)m_basestream).FlushFinalBlock();
|
|
m_hasFlushed = true;
|
|
}
|
|
|
|
base.Dispose(disposing);
|
|
}
|
|
}
|
|
}
|