根据Msdn :
Memory-mapped files enable programmers to work with extremely large files because memory can be managed concurrently, and they allow complete, random access to a file without the need for seeking
问题:
内存映射文件的整个原理是写入/读取字节,并通过位置和偏移量创建 View 。
“无需寻找”是什么意思?
我必须知道开始和结束(偏移量)才能读取文件。
所以寻找确实存在!
我确实在这个巨大的字节数组中寻找......
我错过了什么?
最佳答案
当使用内存映射文件时,您基本上会获得一个指向内存块的指针,并将其作为某种类型的数组进行访问。然后,访问文件中的特定位置是基于索引和/或偏移量的内存访问。操作系统在背后无形地管理着所需的查找。
关于c# - 内存映射文件的误解?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9886415/