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 ]