User1824003892 posted
I have a class that I use to send file data to and from my database, My question is. How do I write file data directly to the "fileData" property in my class without first saving the data to the "ms" memoryStream. Snother question I am
asking. Is wrighting the data to a memory stream the most effecient way to do this. Would there be any advantage to writing the data to the property directly.?
Class Rif
Public Property fileData As Stream
End Class
Dim rif = New Rif
Using stream As Stream = myResp.GetResponseStream()
Using ms As New MemoryStream()
Dim count As Integer
Do
Dim buf As Byte() = New Byte(1023) {}
count = stream.Read(buf, 0, 1024)
ms.Write(buf, 0, count)
Loop While stream.CanRead AndAlso count > 0
rif.fileData = stream