add all
This commit is contained in:
25
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/util/io/compression/Bzip2.cs
vendored
Normal file
25
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/util/io/compression/Bzip2.cs
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System.IO;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Compression
|
||||
{
|
||||
using Impl = Utilities.Bzip2;
|
||||
|
||||
internal static class Bzip2
|
||||
{
|
||||
internal static Stream CompressOutput(Stream stream, bool leaveOpen = false)
|
||||
{
|
||||
return leaveOpen
|
||||
? new Impl.CBZip2OutputStreamLeaveOpen(stream)
|
||||
: new Impl.CBZip2OutputStream(stream);
|
||||
}
|
||||
|
||||
internal static Stream DecompressInput(Stream stream)
|
||||
{
|
||||
return new Impl.CBZip2InputStream(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/util/io/compression/Bzip2.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/util/io/compression/Bzip2.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d04b453ee61d0b549821205ed981a483
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
50
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/util/io/compression/ZLib.cs
vendored
Normal file
50
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/util/io/compression/ZLib.cs
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System.IO;
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
using System.IO.Compression;
|
||||
#else
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib;
|
||||
#endif
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Compression
|
||||
{
|
||||
internal static class ZLib
|
||||
{
|
||||
internal static Stream CompressOutput(Stream stream, int zlibCompressionLevel, bool leaveOpen = false)
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
return new ZLibStream(stream, GetCompressionLevel(zlibCompressionLevel), leaveOpen);
|
||||
#else
|
||||
return leaveOpen
|
||||
? new ZOutputStreamLeaveOpen(stream, zlibCompressionLevel, false)
|
||||
: new ZOutputStream(stream, zlibCompressionLevel, false);
|
||||
#endif
|
||||
}
|
||||
|
||||
internal static Stream DecompressInput(Stream stream)
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
return new ZLibStream(stream, CompressionMode.Decompress, leaveOpen: false);
|
||||
#else
|
||||
return new ZInputStream(stream);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
internal static CompressionLevel GetCompressionLevel(int zlibCompressionLevel)
|
||||
{
|
||||
return zlibCompressionLevel switch
|
||||
{
|
||||
0 => CompressionLevel.NoCompression,
|
||||
1 or 2 or 3 => CompressionLevel.Fastest,
|
||||
7 or 8 or 9 => CompressionLevel.SmallestSize,
|
||||
_ => CompressionLevel.Optimal,
|
||||
};
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/util/io/compression/ZLib.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/util/io/compression/ZLib.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b0af16ed78741a14c88aa3b66f6d4b2f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
37
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/util/io/compression/Zip.cs
vendored
Normal file
37
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/util/io/compression/Zip.cs
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System.IO;
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
using System.IO.Compression;
|
||||
#else
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib;
|
||||
#endif
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Compression
|
||||
{
|
||||
internal static class Zip
|
||||
{
|
||||
internal static Stream CompressOutput(Stream stream, int zlibCompressionLevel, bool leaveOpen = false)
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
return new DeflateStream(stream, ZLib.GetCompressionLevel(zlibCompressionLevel), leaveOpen);
|
||||
#else
|
||||
return leaveOpen
|
||||
? new ZOutputStreamLeaveOpen(stream, zlibCompressionLevel, true)
|
||||
: new ZOutputStream(stream, zlibCompressionLevel, true);
|
||||
#endif
|
||||
}
|
||||
|
||||
internal static Stream DecompressInput(Stream stream)
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
return new DeflateStream(stream, CompressionMode.Decompress, leaveOpen: false);
|
||||
#else
|
||||
return new ZInputStream(stream, true);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/util/io/compression/Zip.cs.meta
vendored
Normal file
11
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/util/io/compression/Zip.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 398602b3dbbd7f1458ca04870a4452ed
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user