I have a some issue in stream reading from WebRequest.GetResponseStream().
I'm trying to download the binary file from web by https proto in Unity using HttpWebRequest\HttpWebResponse (C#). I'm using WebResponse.GetResponseStream() and Stream.read() to read data by limited chunks (1024 bytes) (Want to move downloading in separate thread and show downloading progress bars). During the tests I found that the Stream.read not always returns 1024 bytes read. Some read chunks has 1023 bytes (one of 12-15 chunks). And much rearely have only 1-9 bytes read.
I have not tested that the incoming file recieved ok or corrupted yet. But i have suggestion that those rearly small chunks of 1-9 bytes are that loss bytes in chunks of 1023 bytes. Is there a chance that i will get an incorrect recieved bytes sequence? Is this issue normal at all? Thank's