With big file i mean file biger then RecieveBuffer.
Now, RecBuf should hold first 8192 bytes of data. Instead, it holds 7k of valid data and rest is full of 0.
When i read 20 times and then write everything to file i got invalid file: 7k valid data, 1k of 00 and so on...
How should i solve this?
Code:
Dim nStream As NetworkStream
If nStream.DataAvailable = True Then
Dim recbuf(client.ReceiveBufferSize-1) As Byte
nStream.Read(recbuf, 0, client.ReceiveBufferSize)
end if
Now, RecBuf should hold first 8192 bytes of data. Instead, it holds 7k of valid data and rest is full of 0.
When i read 20 times and then write everything to file i got invalid file: 7k valid data, 1k of 00 and so on...
How should i solve this?