Video is ready, Click Here to View ×

File I/O is an inescapable part of being a software developer.

In looking at the Javadoc for the package, we see a dizzying array of classes.

Do you use byte streams or character streams? Which classes do you use?

In this episode I’ll break it down and help you make sense out of it.

As Java developers, we need to read and write files all the time.

The JDK’s io package provides us with a lot of great tools for doing so, but can be daunting for new developers.

The text file is by far the most common type of file I use in the business world, so that’s what I’ll focus on in this video.

I’ll show you how to read and write text files using the Reader and Writer, respectively.

There are lots of classes, but I like those and recommend them for processing text files.

In this video, I’ll show you how to:

* Create test data using lorem ipsum (7:45)
* Use FileReader to read from a file (12:00)
* Use FileWriter to write to a file (13:10)
* Use InputStreamReader to read a file (17:55)
* Use OutputStreamWriter to write a file (19:52)

Java I/O Javadoc:

Javadoc: AutoCloseable interfce:

Lorem Ipsum generator site:

Github URL:

Subscribe to Makoto TV if you liked this video:

Check out our blog:

Follow me on Linked In:
Follow me on Twitter: @jstevenperry

Thanks for watching!