Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all, I'm currently working on a college project using Visual studio 2008< C#,windows form application.

In the very 1st part of my program, i need to generate a large number of double array [144], like 10 thousand of them. It is very time-consuming and i need to repeat the step everytime i start my program.

So, i'm thinkin of generating these large number of double array and store it into some external data. Then everytime i start my program, my program will load these large number of double array in the program memory.

So, can i acchieve this by using I/O stream? How?
Posted

The simples way will be serialization. You can use binary or XML one.

I think that XML one will be OK for you. Check XmlSerializer on MSDN.
 
Share this answer
 
You could best use the BinaryWriter Read/Write overload functions for Double to do that.

http://msdn.microsoft.com/en-us/library/ez8wcba9.aspx[^]

For seeking you simply take the index and multiply it with the size of a double to get at the correct file position.
BinaryWriterObject.Seek(index * sizeof(double), SeekOrigin.Begin);


Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900