I try to read a stream and save it as byte array to add it later to zip file.
this is the code that I use
Expand|Select|Wrap|Line Numbers
- Dim totalbytes As Byte() = Nothing
- Dim iBytesRead As Integer
- Dim sChunks As FileStream = File.OpenRead("c:\myfile.wav")
- Dim Totalread As Int64 = 0
- ReDim totalbytes(sChunks.Length)
- Do
- iBytesRead = sChunks.Read(totalbytes, Totalread, Totalread+ 1048576)
- Totalread+= iBytesRead
- Loop While Not iBytesRead = 0
- sChunks.Close()
- Return totalbytes
Can you please help me in that.
Thank you