File Reading Explanation
i'm having problems understanding the following section of code:
would anybody be able to explain this to me please?
int returnVal = fc.showOpenDialog(FileChooser.this); //...then open the file chooser box.
if (returnVal == JFileChooser.APPROVE_OPTION)
File file = fc.getSelectedFile(); //Get the file selected by the user.
FileInputStream fis = null;
BufferedInputStream bis = null;
DataInputStream dis = null;
fis = new FileInputStream(file);
bis = new BufferedInputStream(fis);
dis = new DataInputStream(bis);
So far i've got that it reads the file line by line in the form of DataInputStream. But why are the FileInputStream and BufferedInputStream needed?
First of all, do you know the difference of the following.
Just read about those things first of all, then you can find the solution. Read carefully about the usage of each.
That's really nice. So what's the point you mess-up with, if you have any on that?