I'm having problems trying to read a file directly from the hard drive with IntPtr, Currently I'm reading it by first using FileStream to pass it to a byte array, and then copying the byte array to the IntPtr. But this method causes overflow when handing a big file. This is why I'm now trying to read the file directly from hard drive using IntPtr but I haven't found out a way to do this.
Asked
Active
Viewed 1,131 times
1 Answers
1
An IntPtr
is just a pointer, so it can't contain the data itself, there has to be a buffer where the actual data is contained.
So, using one kind of buffer instead of another is not going to solve your problem. If your file doesn't fit in memory, then you just have to process it in smaller pieces.

Guffa
- 687,336
- 108
- 737
- 1,005