Update issue #92 Duplicati 2.0 trunk now uses SharpCompress and allows compression using LZMA (and bz2, etc.) Big thanks to Simon Colmer for working on this! For now the file format is still zip, but the compression inside is different. Once SharpCompress supports 7zip write, we can add that easily. Same goes for LZMA2 compression. git-svn-id: https://duplicati.googlecode.com/svn/trunk@1397 59da171f-624f-0410-aa54-27559c288bec
36 lines
915 B
C#
36 lines
915 B
C#
using System.IO;
|
|
|
|
namespace Duplicati.Library.Compression
|
|
{
|
|
|
|
/// <summary>
|
|
/// CompressionStream wrapper to prevent closing the base stream when disposing the entry stream
|
|
/// </summary>
|
|
public class StreamWrapper : Utility.OverrideableStream
|
|
{
|
|
public delegate void DisposingHandler(StreamWrapper sender);
|
|
|
|
public event DisposingHandler Disposing;
|
|
|
|
public StreamWrapper(Stream stream)
|
|
: base(stream)
|
|
{
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (!disposing || m_basestream == null) return;
|
|
|
|
if (Disposing != null)
|
|
Disposing(this);
|
|
|
|
m_basestream.Dispose();
|
|
m_basestream = null;
|
|
}
|
|
|
|
public long GetSize()
|
|
{
|
|
return m_basestream == null ? 0 : m_basestream.Length;
|
|
}
|
|
}
|
|
} |