diff options
author | Atsushi Eno <atsushi@ximian.com> | 2011-06-13 16:35:16 +0400 |
---|---|---|
committer | Atsushi Eno <atsushi@ximian.com> | 2011-06-13 16:35:16 +0400 |
commit | 012a859db4a83106c975719ecb11ef01f46a8f1a (patch) | |
tree | a62cfaace3d2fb4a36edc3a06255dbf7cc2daf3d /mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher | |
parent | 8219d05935eb1750610ef4f1eac8436a933d7dd5 (diff) |
Fix 2.0 build.
Diffstat (limited to 'mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher')
-rw-r--r-- | mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs index 9553f2854c0..9e0c915dba2 100644 --- a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs +++ b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs @@ -612,7 +612,16 @@ namespace System.ServiceModel.Dispatcher var ms = Stream as MemoryStream; if (ms == null) { ms = new MemoryStream (); +#if NET_4_0 || NET_2_1 Stream.CopyTo (ms); +#else + byte [] tmp = new byte [0x1000]; + int size; + do { + size = Stream.Read (tmp, 0, tmp.Length); + ms.Write (tmp, 0, size); + } while (size > 0); +#endif this.Stream = ms; } return new RawMessageBuffer (ms.ToArray (), headers, properties); |