Geeks With Blogs

News Blog moved to http://blachniet.com
Brian Lachniet April 2011 Entries
MemoryStream.ToArray() VS MemoryStream.GetBuffer()
From MSDN (http://msdn.microsoft.com/... Note that the buffer contains allocated bytes which might be unused. For example, if the string "test" is written into the MemoryStream object, the length of the buffer returned from GetBuffer is 256, not 4, with 252 bytes unused. To obtain only the data in the buffer, use the ToArray method; however, ToArray creates a copy of the data in memory ......

Posted On Wednesday, April 13, 2011 8:17 AM

Copyright © blachniet | Powered by: GeeksWithBlogs.net