When we have to use FileInputStream() or FileReader()?

Showing Answers 1 - 7 of 7 Answers

ajaykjha

  • Oct 16th, 2006
 

The FileInputStream class creates an InputStream that we can use to read bytes from a file. While the byte stream classes provide sufficient functionality to handle any type of I/O operation, they can't work directly with unicode characters. Since one of the main purposes of java is to support the "write once, run anywhere" philosphy, it was neccessary to include direct I/O support for characters. For this we use FileReader.

  Was this answer useful?  Yes

Thiyagarajan.N

  • Mar 20th, 2007
 

FileInputStream is used to read the file byte by bytes. FileReader is used to read the file character by character.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions