Game Development Reference
byte data = new byte[bytesRead];
Array.Copy(state.ProcessBuffer, 0, data, 0, bytesRead);
state.BytesRead += bytesRead;
Notify any callbacks attached to the progress update event.
if (state.ProgressUpdate != null)
Call another data read cycle until there are no more bytes to read.
All the data has been downloaded, so we can now close the response stream and
signal the complete event.
Using the asynchronous download system is very easy. Simply specify the resource
address, and bind the two callbacks to handle progress updates and the download
complete event. After which, call the Initiate() method to begin downloading.