The code below download the files on the web.
/******************** begin of the code ********************/
byte[] buf = new byte[BUFFER_SIZE];
System.IO.FileStream stream = new System.IO.FileStream(filename, System.IO.FileMode.Create);
int n = streamReader.Read(buf, 0, BUFFER_SIZE);
while (n > 0) {
stream.Write(buf, 0, n);
n = streamReader.Read(buf, 0, BUFFER_SIZE);
}
stream.Close();
--- snip ---
/******************** end of the code ********************/
However, I do not know what you want to do. Char in C# represents the Unicode character and it is different from the char in C/C++, which can be used for representing 1 byte data. Do you want to generate HEX dump of binary data?