【发布时间】:2016-09-13 17:31:55
【问题描述】:
我正在打开一个非常小的文件(大约 200 kb),然后我在 BufferedStream 中打开它,因为我要多次阅读它。当我尝试创建 BufferedStream 时,我得到一个 IOException:
var stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, 4096, true);
using (var bfs = new BufferedStream(stream)); // IOException: An attempt was made to move the file pointer before the beginning of the file.
什么可能导致 IO 异常?我的应用正在使用 .NET 4.6
【问题讨论】:
标签: c# file exception io .net-4.6