Any one tell me the exact difference between MemoryStream Read() method and GetBuffer(). I want an exact behavoiur of these two methods.
Cheer.
Any one tell me the exact difference between MemoryStream Read() method and GetBuffer(). I want an exact behavoiur of these two methods.
Cheer.
Difference between MemoryStream Read() and GetBuffer().
kingace
Hi!
Read() will copy bytes into YOUR buffer, GetBuffer() will give you access to OWN buffer that MemoryStream use for itself.
I don't think you can keep GetBuffer()-given reference too long, because when stream write something it can reallocate buffer.