Posts Tagged ‘File Reading

Different File Read Write Stream Classes in Java

Byte streams, character streams, buffered streams, data streams and object streams are different data reading mechanisms for File IO. Each of the stream has a unique purpose to serve. In this article, we explore details of these streams. Also, we try to find when to use which stream.

Byte Streams:
java.io.FileInputStream and java.io.FileOutputStream are the two classes [...]

Java

Reading Text File Line by Line in Java 6

Here is code you will need in Java 6 to read a file on the machine. It uses BufferReader through FileReader. Some of the things you should remember are -

Close the BufferReader in finally block so that it is closed any case.
In BufferReader.close you can opt to ignore exception.
Check the size of file you are [...]

Java