summary refs log tree commit diff
path: root/crypto/src/openpgp/PgpCompressedData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/openpgp/PgpCompressedData.cs')
-rw-r--r--crypto/src/openpgp/PgpCompressedData.cs23
1 files changed, 11 insertions, 12 deletions
diff --git a/crypto/src/openpgp/PgpCompressedData.cs b/crypto/src/openpgp/PgpCompressedData.cs
index fc7d200d0..346b0b1a1 100644
--- a/crypto/src/openpgp/PgpCompressedData.cs
+++ b/crypto/src/openpgp/PgpCompressedData.cs
@@ -1,7 +1,6 @@
 using System.IO;
 
-using Org.BouncyCastle.Bzip2;
-using Org.BouncyCastle.Utilities.Zlib;
+using Org.BouncyCastle.Utilities.IO.Compression;
 
 namespace Org.BouncyCastle.Bcpg.OpenPgp
 {
@@ -38,16 +37,16 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp
         {
             switch (Algorithm)
             {
-				case CompressionAlgorithmTag.Uncompressed:
-					return GetInputStream();
-				case CompressionAlgorithmTag.Zip:
-					return new ZInputStream(GetInputStream(), true);
-                case CompressionAlgorithmTag.ZLib:
-					return new ZInputStream(GetInputStream());
-				case CompressionAlgorithmTag.BZip2:
-					return new CBZip2InputStream(GetInputStream());
-                default:
-                    throw new PgpException("can't recognise compression algorithm: " + Algorithm);
+			case CompressionAlgorithmTag.Uncompressed:
+				return GetInputStream();
+			case CompressionAlgorithmTag.Zip:
+                return Zip.DecompressInput(GetInputStream());
+            case CompressionAlgorithmTag.ZLib:
+				return ZLib.DecompressInput(GetInputStream());
+			case CompressionAlgorithmTag.BZip2:
+                return Bzip2.DecompressInput(GetInputStream());
+            default:
+                throw new PgpException("can't recognise compression algorithm: " + Algorithm);
             }
         }
     }