Call SetEndOfSendNotification
[mono.git] / mcs / class / System.Web / System.Web / HttpResponseStream.jvm.cs
index a8fa6450a600a96ea95fc335001e0052cc702171..bbbc1cd2d646b19a6b2112b6a151c1b993fb9055 100644 (file)
@@ -224,9 +224,8 @@ namespace System.Web
                                if (_position == 0)
                                        return;
 
-                               StreamWriter writer = new StreamWriter (stream);
-                               writer.Write (buffer, 0, _position);
-                               writer.Flush ();
+                               byte[] bytesToWrite =_encoding.GetBytes (buffer, 0, _position);
+                               stream.Write (bytesToWrite, 0, bytesToWrite.Length);
                        }
                }
 
@@ -385,8 +384,8 @@ namespace System.Web
                                // Write to the filter, which will call us back, and then Flush
                                filtering = true;
                                try {
-                                       StreamWriter wr = new StreamWriter (filter, response.ContentEncoding);
-                                       wr.Write (buffer, offset, count);
+                                       byte [] bytesToWrite = response.ContentEncoding.GetBytes (buffer, offset, count);
+                                       filter.Write (bytesToWrite, 0, bytesToWrite.Length);
                                }
                                finally {
                                        filtering = false;
@@ -414,8 +413,8 @@ namespace System.Web
                                // Write to the filter, which will call us back, and then Flush
                                filtering = true;
                                try {
-                                       StreamWriter wr = new StreamWriter (filter, response.ContentEncoding);
-                                       wr.Write (s, offset, count);
+                                       byte [] bytesToWrite = response.ContentEncoding.GetBytes (s.ToCharArray (), offset, count);
+                                       filter.Write (bytesToWrite, 0, bytesToWrite.Length);
                                }
                                finally {
                                        filtering = false;