I use a BinaryReader(MemoryStream(MyByteArray))) to read variable sized records and process them all in memory. This works well as long as my bytestream which is in the array is less than about 1.7G in size. After that (which is the maximum size of an integer in my 64bit system) you cannot create a larger bytearray, although I have enough real memory. So my solution has been to read the bytestream and split it into several bytearrays.
Now however, I cannot "read" across the bytearray boundaries and as my data is in variable format I cannot ensure that bytearrays always finish on a whole record.
This must be a common problem for people processing very large datasets and still have the need for speed.
Any suggestions would be appreciated.