When I use FileInputStream to read an object (say, several bytes), does the basic operation do:
1) Read the entire disk block, so that if I subsequently do another read operation, this does not require reading the real disk, since this part of the file has already been extracted in the last read operation?
OR
2) New disk access because FileInputStream does not do any buffering, and should bufferedInputStream be used instead to achieve effect (1)?
I think that since FileInputStream uses the read system call and it only reads a set of pages from the hard drive, some buffering needs to be done.
source share