From a813fc246df9b52960cef8230bcdb974dfac71aa Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Wed, 30 May 2018 15:23:45 +0200 Subject: [PATCH] Add PlatformNotSupportedException for SyncStream due to https://github.com/dotnet/corert/issues/3251 --- src/System.Private.CoreLib/shared/System/IO/Stream.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/System.Private.CoreLib/shared/System/IO/Stream.cs b/src/System.Private.CoreLib/shared/System/IO/Stream.cs index 53013bac0960..a8b473c446af 100644 --- a/src/System.Private.CoreLib/shared/System/IO/Stream.cs +++ b/src/System.Private.CoreLib/shared/System/IO/Stream.cs @@ -1237,6 +1237,9 @@ public override int ReadByte() public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, Object state) { +#if CORERT + throw new PlatformNotSupportedException(); // TODO: https://github.com/dotnet/corert/issues/3251 +#else bool overridesBeginRead = _stream.HasOverriddenBeginEndRead(); lock (_stream) @@ -1251,6 +1254,7 @@ public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, Asy _stream.BeginRead(buffer, offset, count, callback, state) : _stream.BeginReadInternal(buffer, offset, count, callback, state, serializeAsynchronously: true, apm: true); } +#endif } public override int EndRead(IAsyncResult asyncResult) @@ -1294,6 +1298,9 @@ public override void WriteByte(byte b) public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, Object state) { +#if CORERT + throw new PlatformNotSupportedException(); // TODO: https://github.com/dotnet/corert/issues/3251 +#else bool overridesBeginWrite = _stream.HasOverriddenBeginEndWrite(); lock (_stream) @@ -1308,6 +1315,7 @@ public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, As _stream.BeginWrite(buffer, offset, count, callback, state) : _stream.BeginWriteInternal(buffer, offset, count, callback, state, serializeAsynchronously: true, apm: true); } +#endif } public override void EndWrite(IAsyncResult asyncResult)