diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-10-24 15:49:27 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-10-24 15:49:27 +0700 |
commit | be97c80fdecadac37413a6a6a8de417e0332f6bf (patch) | |
tree | def3bf31b937a4e59458574f6441036ffdf61616 /crypto/src/cms/CMSCompressedData.cs | |
parent | Use correct OID (diff) | |
download | BouncyCastle.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.cs | 8 |
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 { |