We want to fetch 15GB of file in one go. Currently we are using byte[] for fetching contents. However we get"Array dimensions exceeded supported range" error
Is there any other way round
We want to fetch 15GB of file in one go. Currently we are using byte[] for fetching contents. However we get"Array dimensions exceeded supported range" error
Is there any other way round
You gotta push your RAM up if you're willing to load up to 15 GO of data in your program !
StreamReader is a solution. Another seems to MemoryMappedFile as mentionned here : Large File read - Stack Overflow. Never tested it though.
It's hard to provide you with a good answer without more details of what you're trying to do. These may help you though:
The maximum index supported by an array in C# is Int32.MaxValue. You may be hitting this limit here.
.NET also imposes a 2GB object size limit. You can get around this by enabling gcAllowVeryLargeObjects.
As other users have pointed out Stream or a MemoryMappedFile might provide you with alternatives to reading into a byte[].