请教一下C#文件操作问题。

文件大小是30M.从17M左右开始读取3M字节,
将file_len 改成常量比如300万。就没有问题,使用成变量就是会报告:
Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
错误。

    file_postion和file_len 是函数参数(int)

     byte [] buffer = new byte[file_len];
     FileStream fs = new FileStream(“txt”, FileMode.Open, FileAccess.ReadWrite);
     BinaryReader Reader = new BinaryReader(fs);
     Reader.Read(buffer, file_postion, filelen);
     Reader.Close();
     fs.Close();

问题取消,自己理解错误。谢谢

你调试看看这两个变量的值,是不是有问题