I want to write to memory a string "Hello World!" and i want to read it from memory using "Memory Stream" in Visual Basic.NET 2003. Can you please provide me the sample code for that ? Advance thanks for your time & patience.
Here is the sample code to write data:
Public Sub WriteToStream()
Dim ms As New MemoryStream
Dim strText As String = "Hello World!"
Dim enc As New UTF8Encoding
Dim arrBytData() As Byte = enc.GetBytes(strText)
ms.Write(arrBytData, 0, arrBytData.Length)
ms = Nothing