Hi,
In order to read the bytes you can use
FileStream
class.
FileStream stream = new FileStream("pathtodoc.ext", FileMode.Open);
byte [] array = new byte[stream.Length];
int bytesread = stream.Read(array, 0, stream.Length);
In order to write back the bytes into stream use
Write
method.
FileStream stream = new FileStream("pathtodoc.ext", FileMode.Create);
stream.Write(array, 0, stream.Length);
Regards