Using Memory Streams

Memory streams are special objects that act like file streams but that work in memory, providing the ability to manipulate binary data. The following code creates a MemoryStream with 2 Kbytes capacity and puts in a string:

image

To retrieve data you use a BinaryReader pointing to the MemoryStream as you saw in the paragraph for binary files. So, in this example, you can simply invoke ReadString as follows:

image

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.168.2