L Bunny

Greenhorn
+ Follow
since Nov 27, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by L Bunny

Correction:
It should be BufferedWriter and FileChannel
16 years ago
I have this code (BufferedReader) to write data that I read from a table to an output file.

8 records are retrieved from a table and it tooks 00:00:01.40300 to write to an output file and the output file size is 3KB.

Then, i use FileChannel to do the same thing. But it tooks 00:00:01.63200 to write to an output file and the outfile file size is 2151KB

Question:-
1. There is no way for me to pre-allocate ByteBuffer size because I won't know the size until i read the value of a column from ResultSet, right?

2. Should I make a conclusion that BufferedWriter is better than FileChannel when reading data from a table and writing it to an output file? If I am wrong, can someone please help to correct my mistake by providing some source code to modify my FileChannel source code?

Thanks to all the guru and experts 1st.
[ November 27, 2007: Message edited by: Jim Yingst ]
16 years ago