fastest way to write and read bytes of data

  • Thread starter Thread starter tim
  • Start date Start date
T

tim

I have a multi-dimensional byte array,
private someArray(,,) as byte
and it's huge
redim someArray(100,640,480,3)

after populating the array, I write it to a text file to
save it. (so I don't run out of memory). I will retrieve
from the file later.

What I do is use streamwriter.write and streamreader.read
to write and read to text file.
1) Is there a faster way to write and read data?
(I noticed write seems faster than writeline)
2) Is writing to textfile and binary file the same in speed
 
I've never tried to us the StreamWriter or Reader. I would try using a
FileStream though but that's just me. I would also use the BeginRead and
BeginWrite methods in the stream as that would not lock your application
while the data is written or read from the stream. Also unless you need all
that data at once I wold recomend reading a set amout of data, process it
and then read the next chunk.
 
Back
Top