summary refs log tree commit diff
path: root/crypto/src/asn1
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2015-11-04 19:28:43 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2015-11-04 19:28:43 +0700
commitf56fc16973d66bd9461f247e50738e55bd54de7e (patch)
tree8e84c9bd2cfc2d554b99c8045ec46de7313410fc /crypto/src/asn1
parentPort updated revocation test from Java (diff)
downloadBouncyCastle.NET-ed25519-f56fc16973d66bd9461f247e50738e55bd54de7e.tar.xz
Replace Close with Dispose for PORTABLE
Diffstat (limited to 'crypto/src/asn1')
-rw-r--r--crypto/src/asn1/BEROctetStringGenerator.cs18
-rw-r--r--crypto/src/asn1/util/FilterStream.cs11
2 files changed, 28 insertions, 1 deletions
diff --git a/crypto/src/asn1/BEROctetStringGenerator.cs b/crypto/src/asn1/BEROctetStringGenerator.cs
index 7468a6b0b..b2fbd47ae 100644
--- a/crypto/src/asn1/BEROctetStringGenerator.cs
+++ b/crypto/src/asn1/BEROctetStringGenerator.cs
@@ -102,7 +102,22 @@ namespace Org.BouncyCastle.Asn1
 				}
 			}
 
-			public override void Close()
+#if PORTABLE
+            protected override void Disposing(bool disposing)
+            {
+                if (disposing)
+                {
+				    if (_off != 0)
+				    {
+					    DerOctetString.Encode(_derOut, _buf, 0, _off);
+				    }
+
+				    _gen.WriteBerEnd();
+                }
+                base.Dispose(disposing);
+            }
+#else
+            public override void Close()
 			{
 				if (_off != 0)
 				{
@@ -112,6 +127,7 @@ namespace Org.BouncyCastle.Asn1
 				_gen.WriteBerEnd();
 				base.Close();
 			}
+#endif
 		}
 	}
 }
diff --git a/crypto/src/asn1/util/FilterStream.cs b/crypto/src/asn1/util/FilterStream.cs
index e280bf5b5..f7e8708f3 100644
--- a/crypto/src/asn1/util/FilterStream.cs
+++ b/crypto/src/asn1/util/FilterStream.cs
@@ -34,10 +34,21 @@ namespace Org.BouncyCastle.Asn1.Utilities
             get { return s.Position; }
             set { s.Position = value; }
         }
+#if PORTABLE
+        protected override void Disposing(bool disposing)
+        {
+            if (disposing)
+            {
+                Platform.Dispose(s);
+            }
+            base.Dispose(disposing);
+        }
+#else
         public override void Close()
         {
             Platform.Dispose(s);
         }
+#endif
         public override void Flush()
         {
             s.Flush();