Colleagues,
As established here in the past, the String size limit is 2 GB, but it's better bet to limit it to 1 Gb.
I have files that all are smaller than that (300+ MB max.) that my Program needs to read, and this is where I hit the roadblock!
Here's the problem:
My.Computer.FileSystem.ReadAllText() function can't read files over 8 Mb in size: system suspends execution with this screen:
It's showing up in the Debug mode. I can just select "Continue execution", but it's not a solution.
I tried to find a function/method (e.g. in StreamReader) that reads a large ASCII file by chunks of the ordered size in bytes, and couldn't find any that would exactly fit for my purpose.
For instance:
StreamReader.Peek() - "Returns the next available character", that is reads just one;
StreamReader.Read(Char[], Int32, Int32) - "Reads a specified maximum of characters from the current stream into a buffer, beginning at the specified index" - closer, but the "buffer" is an array of Chars, not a String.
Are there any other, more easily applicable solution to this problem than that latter?
AHWBGA!
P.S. By my past experience (e.g. in late 1990s-2000s), String size was limited to 16 Mb... but, as stated above, even that breaks the system in VS 2019's VB.NET...
As established here in the past, the String size limit is 2 GB, but it's better bet to limit it to 1 Gb.
I have files that all are smaller than that (300+ MB max.) that my Program needs to read, and this is where I hit the roadblock!
Here's the problem:
My.Computer.FileSystem.ReadAllText() function can't read files over 8 Mb in size: system suspends execution with this screen:
It's showing up in the Debug mode. I can just select "Continue execution", but it's not a solution.
I tried to find a function/method (e.g. in StreamReader) that reads a large ASCII file by chunks of the ordered size in bytes, and couldn't find any that would exactly fit for my purpose.
For instance:
StreamReader.Peek() - "Returns the next available character", that is reads just one;
StreamReader.Read(Char[], Int32, Int32) - "Reads a specified maximum of characters from the current stream into a buffer, beginning at the specified index" - closer, but the "buffer" is an array of Chars, not a String.
Are there any other, more easily applicable solution to this problem than that latter?
AHWBGA!
P.S. By my past experience (e.g. in late 1990s-2000s), String size was limited to 16 Mb... but, as stated above, even that breaks the system in VS 2019's VB.NET...