I need to be able to read a file from a certain starting points. Example... Start at byte offset 2, and then read 400 bytes after that. My code below works fine when I start from offset zero, but if I try anything else like start at offset 2 and read 400 bytes, it throws and exception of out of bounds or count to big.
int ncount = 400;
FileStream fs = File.OpenRead(mfilepath); // opening a file stream object
byte data = new byte[ncount]; //creating a byte array with the ncount size
fs.Read(data, 0, 400); //this works
// this one does not work.... fs.Read(data, 2, 400);