* UnmanagedMemoryStream.cs: Read: don't read bytes one-by-one, read all
at once.
svn path=/trunk/mcs/; revision=149555
+2010-01-14 Rolf Bjarne Kvinge <RKvinge@novell.com>
+
+ * UnmanagedMemoryStream.cs: Read: don't read bytes one-by-one, read all
+ at once.
+
2010-01-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* MemoryStream.cs: Don't clear the bytes beyond Length when shrinking
return (0);
else {
int progress = current_position + count < length ? count : (int) (length - current_position);
- for (int i = 0; i < progress; i++)
- buffer [offset + i] = Marshal.ReadByte (initial_pointer, (int) current_position++);
+ Marshal.Copy (new IntPtr (initial_pointer.ToInt64 () + current_position), buffer, offset, progress);
+ current_position += progress;
return progress;
}
}