summary refs log tree commit diff
path: root/crypto/src/util/io/BaseOutputStream.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/util/io/BaseOutputStream.cs')
-rw-r--r--crypto/src/util/io/BaseOutputStream.cs20
1 files changed, 18 insertions, 2 deletions
diff --git a/crypto/src/util/io/BaseOutputStream.cs b/crypto/src/util/io/BaseOutputStream.cs
index 6e6c6d346..d85ae8ae4 100644
--- a/crypto/src/util/io/BaseOutputStream.cs
+++ b/crypto/src/util/io/BaseOutputStream.cs
@@ -11,8 +11,24 @@ namespace Org.BouncyCastle.Utilities.IO
 		public sealed override bool CanRead { get { return false; } }
         public sealed override bool CanSeek { get { return false; } }
         public sealed override bool CanWrite { get { return !closed; } }
-		public override void Close() { closed = true; }
-        public override void Flush() {}
+
+#if PORTABLE
+        protected override void Disposing(bool disposing)
+        {
+            if (disposing)
+            {
+                closed = true;
+            }
+            base.Dispose(disposing);
+        }
+#else
+        public override void Close()
+        {
+            closed = true;
+        }
+#endif
+
+        public override void Flush() { }
         public sealed override long Length { get { throw new NotSupportedException(); } }
         public sealed override long Position
         {