K
Kevin
Hello all:
I am just wondering whether there is any reference/comparison of how to
save and load java's data types fast, into/from disk files?
For example, what class/method to use if I want to save 10 million
integer and/or double and/or String into a file in order, and later to
read them back in that order?
Current, I use ObjectOutputStream over buffered file, and use writeInt,
writeDouble, writeUTF for this purpose.
I tested that on my WinXP computer, writing 10 million double needs
about 6 seconds, resulting in a file of 76M, and reading them back
needs 4 seconds. Since I have no comparsion, so I suppose this is the
fastest speed I can get, right?
Thanks a lot and have a nice weekend!
Kevin
PS: I mean to use the supplied classes from standard Sun Java only ----
I do not want to create any very complicated "smart" classes that lose
generality.
I am just wondering whether there is any reference/comparison of how to
save and load java's data types fast, into/from disk files?
For example, what class/method to use if I want to save 10 million
integer and/or double and/or String into a file in order, and later to
read them back in that order?
Current, I use ObjectOutputStream over buffered file, and use writeInt,
writeDouble, writeUTF for this purpose.
I tested that on my WinXP computer, writing 10 million double needs
about 6 seconds, resulting in a file of 76M, and reading them back
needs 4 seconds. Since I have no comparsion, so I suppose this is the
fastest speed I can get, right?
Thanks a lot and have a nice weekend!
Kevin
PS: I mean to use the supplied classes from standard Sun Java only ----
I do not want to create any very complicated "smart" classes that lose
generality.