summary refs log tree commit diff
path: root/crypto/src/cms/CMSCompressedData.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-10-24 15:49:27 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-10-24 15:49:27 +0700
commitbe97c80fdecadac37413a6a6a8de417e0332f6bf (patch)
treedef3bf31b937a4e59458574f6441036ffdf61616 /crypto/src/cms/CMSCompressedData.cs
parentUse correct OID (diff)
downloadBouncyCastle.NET-ed25519-be97c80fdecadac37413a6a6a8de417e0332f6bf.tar.xz
Use platform compression where available
- Move Bzip2 code into Utilities
Diffstat (limited to 'crypto/src/cms/CMSCompressedData.cs')
-rw-r--r--crypto/src/cms/CMSCompressedData.cs8
1 files changed, 3 insertions, 5 deletions
diff --git a/crypto/src/cms/CMSCompressedData.cs b/crypto/src/cms/CMSCompressedData.cs
index 21651f041..5f8165005 100644
--- a/crypto/src/cms/CMSCompressedData.cs
+++ b/crypto/src/cms/CMSCompressedData.cs
@@ -1,10 +1,9 @@
-using System;
 using System.IO;
 
 using Org.BouncyCastle.Asn1;
 using Org.BouncyCastle.Asn1.Cms;
 using Org.BouncyCastle.Utilities;
-using Org.BouncyCastle.Utilities.Zlib;
+using Org.BouncyCastle.Utilities.IO.Compression;
 
 namespace Org.BouncyCastle.Cms
 {
@@ -45,7 +44,7 @@ namespace Org.BouncyCastle.Cms
             ContentInfo content = comData.EncapContentInfo;
 
 			Asn1OctetString bytes = (Asn1OctetString) content.Content;
-			ZInputStream zIn = new ZInputStream(bytes.GetOctetStream());
+			Stream zIn = ZLib.DecompressInput(bytes.GetOctetStream());
 
 			try
 			{
@@ -76,8 +75,7 @@ namespace Org.BouncyCastle.Cms
 			ContentInfo     content = comData.EncapContentInfo;
 
 			Asn1OctetString bytes = (Asn1OctetString)content.Content;
-
-			ZInputStream zIn = new ZInputStream(new MemoryStream(bytes.GetOctets(), false));
+            Stream zIn = ZLib.DecompressInput(bytes.GetOctetStream());
 
 			try
 			{