2009-08-24 Marek Habersack <mhabersack@novell.com>
[mono.git] / mcs / class / System.Web / System.Web / HttpWriter.cs
index 5fedc0c10b5bde6f6304a09aa041add37c284e16..f695bccc12239b5e772567b964426698a0dfb11f 100644 (file)
@@ -81,6 +81,9 @@ namespace System.Web {
                        }
                }
 
+               internal HttpResponse Response {
+                       get { return response; }
+               }
                //
                // Flush data, and closes socket
                //
@@ -119,11 +122,14 @@ namespace System.Web {
                {
                        if (buffer == null || index < 0 || count < 0 || (buffer.Length - index) < count)
                                throw new ArgumentOutOfRangeException ();
-                       
+#if TARGET_JVM
+                       output_stream.Write (buffer, index, count);
+#else
                        int length = encoding.GetMaxByteCount (count);
                        byte [] bytebuffer = GetByteBuffer (length);
                        int realLength = encoding.GetBytes (buffer, index, count, bytebuffer, 0);
                        output_stream.Write (bytebuffer, 0, realLength);
+#endif
                        if (response.buffer)
                                return;
 
@@ -144,17 +150,25 @@ namespace System.Web {
 
                        if (index < 0 || count < 0 || ((index + count > s.Length)))
                                throw new ArgumentOutOfRangeException ();
-                       
+#if TARGET_JVM
+                       output_stream.Write (s, index, count);
+#else
                        int length = encoding.GetMaxByteCount (count);
                        byte [] bytebuffer = GetByteBuffer (length);
                        int realLength = encoding.GetBytes (s, index, count, bytebuffer, 0);
                        output_stream.Write (bytebuffer, 0, realLength);
+#endif
                        if (response.buffer)
                                return;
 
                        response.Flush ();
                }
 
+               internal void WriteUTF8Ptr (IntPtr ptr, int length)
+               {
+                       output_stream.WritePtr (ptr, length);
+               }
+
                public void WriteBytes (byte [] buffer, int index, int count)
                {
                        output_stream.Write (buffer, index, count);