469,648 Members | 1,168 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,648 developers. It's quick & easy.

fastest way to write and read bytes of data

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
Nov 20 '05 #1
1 2458
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.
"tim" <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
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

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Einar Høst | last post: by
14 posts views Thread by Mark Broadbent | last post: by
5 posts views Thread by Sumana | last post: by
15 posts views Thread by Buddy Home | last post: by
3 posts views Thread by M.-A. Lemburg | last post: by
5 posts views Thread by =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.