From: Marek Safar Date: Thu, 7 Jun 2012 08:30:08 +0000 (+0100) Subject: Add new 4.5 api X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=f1b0051d92f327aa39134e59dd7ea6d4bbd31894;p=mono.git Add new 4.5 api --- diff --git a/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs b/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs index 7b98be5a75c..e749a7cd719 100644 --- a/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs +++ b/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs @@ -31,6 +31,10 @@ using System.Globalization; using System.IO; using System.Runtime.InteropServices; +#if NET_4_5 +using System.Threading; +using System.Threading.Tasks; +#endif namespace System.Security.Cryptography { @@ -357,10 +361,28 @@ namespace System.Security.Cryptography { } } } + #if NET_4_0 public bool HasFlushedFinalBlock { get { return _flushedFinalBlock; } } #endif + +#if NET_4_5 + public override Task FlushAsync (CancellationToken cancellationToken) + { + return base.FlushAsync (cancellationToken); + } + + public override Task ReadAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken) + { + return base.ReadAsync (buffer, offset, count, cancellationToken); + } + + public override Task WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken) + { + return base.WriteAsync (buffer, offset, count, cancellationToken); + } +#endif } } diff --git a/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs b/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs index 4ae6491f2c8..c8160ad4b72 100644 --- a/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs +++ b/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs @@ -57,7 +57,16 @@ namespace System.Security.Cryptography { public abstract void GetBytes (byte[] data); +#if NET_4_5 + public virtual void GetNonZeroBytes (byte[] data) + { + throw new NotImplementedException (); + } +#else public abstract void GetNonZeroBytes (byte[] data); +#endif + + #if NET_4_0 || MOONLIGHT public void Dispose () {