I start out by having a streamwriter write to a memorystream. Then later on I want to retrieve the data from the memorystream. The code, in it's basic form, looks like this:
In debug mode, I can see that the memory stream has the right length, there should be data in it, but nothing comes out.
What could be causing this? If I need to post more of the code, I can.
Thanks
Code:
Dim ms As New MemoryStream
Dim sw As StreamWriter = New StreamWriter(ms)
//code that writes to the stream
Dim sr As New StreamReader(ms)
Dim tmp As String
tmp = sr.ReadToEnd()
sr.Close()
In debug mode, I can see that the memory stream has the right length, there should be data in it, but nothing comes out.
What could be causing this? If I need to post more of the code, I can.
Thanks