summary refs log tree commit diff
path: root/crypto/src/util/io/Streams.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-04-11 14:44:47 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-04-11 14:44:47 +0700
commitfd335142a7a492509dda827ee2b6507a651560b8 (patch)
tree4b8895243d11a29e50ffa3c869ad1507c7358cf0 /crypto/src/util/io/Streams.cs
parentX509: Signature checks that return bool (diff)
downloadBouncyCastle.NET-ed25519-fd335142a7a492509dda827ee2b6507a651560b8.tar.xz
Platform guards for Stream code
Diffstat (limited to '')
-rw-r--r--crypto/src/util/io/Streams.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/src/util/io/Streams.cs b/crypto/src/util/io/Streams.cs
index 69f390646..a1a2ea5d1 100644
--- a/crypto/src/util/io/Streams.cs
+++ b/crypto/src/util/io/Streams.cs
@@ -2,13 +2,15 @@ using System;
 using System.IO;
 using System.Runtime.InteropServices;
 using System.Threading;
+#if NETCOREAPP1_0_OR_GREATER || NET45_OR_GREATER || NETSTANDARD1_0_OR_GREATER
 using System.Threading.Tasks;
+#endif
 
 namespace Org.BouncyCastle.Utilities.IO
 {
     public static class Streams
 	{
-        private static readonly int MaxStackAlloc = Environment.Is64BitProcess ? 4096 : 1024;
+        private static readonly int MaxStackAlloc = Platform.Is64BitProcess ? 4096 : 1024;
 
 		public static int DefaultBufferSize => MaxStackAlloc;
 
@@ -37,6 +39,7 @@ namespace Org.BouncyCastle.Utilities.IO
 #endif
 		}
 
+#if NETCOREAPP1_0_OR_GREATER || NET45_OR_GREATER || NETSTANDARD1_0_OR_GREATER
         public static Task CopyToAsync(Stream source, Stream destination)
         {
             return CopyToAsync(source, destination, DefaultBufferSize);
@@ -69,6 +72,7 @@ namespace Org.BouncyCastle.Utilities.IO
 			}
 #endif
 		}
+#endif
 
         public static void Drain(Stream inStr)
 		{