diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-04-11 14:44:47 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-04-11 14:44:47 +0700 |
commit | fd335142a7a492509dda827ee2b6507a651560b8 (patch) | |
tree | 4b8895243d11a29e50ffa3c869ad1507c7358cf0 /crypto/src/util/io/Streams.cs | |
parent | X509: Signature checks that return bool (diff) | |
download | BouncyCastle.NET-ed25519-fd335142a7a492509dda827ee2b6507a651560b8.tar.xz |
Platform guards for Stream code
Diffstat (limited to '')
-rw-r--r-- | crypto/src/util/io/Streams.cs | 6 |
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) { |