Merge branch 'msbuilddll2'
[mono.git] / mcs / class / corlib / System.IO / FileStream.cs
index 98416dfa82f875a06a564fa7251b9d484c3c80df..62be3c834f4b45562475d9c863997efec66fbf76 100644 (file)
@@ -699,11 +699,14 @@ namespace System.IO
                                MemoryStream ms = new MemoryStream ();
                                FlushBuffer (ms);
                                ms.Write (array, offset, numBytes);
+
+                               // Set arguments to new compounded buffer 
                                offset = 0;
-                               numBytes = (int) ms.Length;
+                               array = ms.ToArray ();
+                               numBytes = array.Length;
                        }
 
-                       WriteDelegate w = new WriteDelegate (WriteInternal);
+                       WriteDelegate w = WriteInternal;
                        return w.BeginInvoke (array, offset, numBytes, userCallback, stateObject);                      
                }