PDA

View Full Version : Efficient file reading


DELOCH
02-23-2009, 04:32 AM
I know how to read files line by line with Scanner,
I know how to read files character by character with Scanner or Pretty much any java.io class

However I want to know how to read a buffer of characters from a file(thus removing the need to interrupt the hard drive many times[to read the file])
I tried BufferedInputStream but it doesn't work well. I also want to write say 500 characters onto a file at once].

I also want to know how to Place a character at a certain position of a file. I tried RandomAccessFile but I don't exactly know how to use it properly, I tried though. I want to read a character at a random position too.

I also want to know how to write one or multiple bytes onto a file[and read it].

DELOCH
03-01-2009, 01:39 AM
anyone?