This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
using System;
using System.IO;
using ICSharpCode.SharpZipLib.Core;
namespace ICSharpCode.SharpZipLib.BZip2
{
// Token: 0x02000002 RID: 2
public static class BZip2
{
// Token: 0x06000001 RID: 1 RVA: 0x000020D0 File Offset: 0x000010D0
public static void Decompress(Stream inStream, Stream outStream, bool isStreamOwner)
{
if (inStream == null || outStream == null)
{
throw new Exception("Null Stream");
}
try
{
using (BZip2InputStream bzip2InputStream = new BZip2InputStream(inStream))
{
bzip2InputStream.IsStreamOwner = isStreamOwner;
StreamUtils.Copy(bzip2InputStream, outStream, new byte[4096]);
}
}
finally
{
if (isStreamOwner)
{
outStream.Close();
}
}
}
// Token: 0x06000002 RID: 2 RVA: 0x00002144 File Offset: 0x00001144
public static void Compress(Stream inStream, Stream outStream, bool isStreamOwner, int level)
{
if (inStream == null || outStream == null)
{
throw new Exception("Null Stream");
}
try
{
using (BZip2OutputStream bzip2OutputStream = new BZip2OutputStream(outStream, level))
{
bzip2OutputStream.IsStreamOwner = isStreamOwner;
StreamUtils.Copy(inStream, bzip2OutputStream, new byte[4096]);
}
}
finally
{
if (isStreamOwner)
{
inStream.Close();
}
}
}
}
}