Start learning now
You've reached Level 19!
Congratulations, you've completed Level 8 of the quest! You've studied input/output streams, learned how to write your own wrapper for System.in, and completed 29 tasks (unless you left a few for later). On Level 9, we'll continue to get acquainted with streams as we study the Reader/Writer interfaces and FileReader/FileWriter classes.
Adapters are part of the Java programming language. They let you connect objects with different interfaces to one another. It's a proven fact that if you want to learn the adapter design pattern well, you'd better understand I/O streams.
Reader and Writer are two abstract classes that are very similar to the InputStream and OutputStream classes. But they work with characters—they read and write characters. Reader and Writer are very convenient for working with textual information. Study them! Use them!
Practice with Reader/Writer
Instead of writing a bazillion different classes, Java's creators wrote two dozen adapters and allowed them to connect to each other in any way a programmer might want. Diego has come up with many different tasks on adapters, Reader, and Writer. Enjoy!
The previous lessons gave you the opportunity to learn about FileInputStream and FileOutputStream, but today students at the secret CodeGym center are preparing to meet the FileReader and FileWriter classes. All these classes are adapters between File objects and the "interfaces" of InputStream, OutputStream, Reader, and Writer. The details are in the lesson!
Practice with FileReader/FileWriter
To master all these adapters, you need to complete many tasks. To feel them, so to speak, with your fingertips or neural endings... or whatever it is that robots have. Your teacher Diego is sweeping aside all hope that CodeGym students will become real programmers. He's literally burying them with tasks.
Programming is practice. That's why sometimes we start using something, but only later do we understand what's what. This is what happened with the BufferedReader and InputSreamReader classes, which CodeGym students use even during the first quest. It's time to understand how they're organized.
Let's write our own wrapper for System.out
In the secret lab of the no less secret CodeGym training center, students are studying object replacement today. Your mentor Bilaabo will show how to write a wrapper for System.out so no one notices the replacement. But first you need to figure out System.out itself.
Practice with streams | Level 9
The time has come for students at the secret CodeGym training center to begin writing their own wrappers. Your teacher Diego invites you to implement five tricky reader wrappers. The trick is different every time. In one case, the reader wrapper replaces all letters with uppercase letters. In another case, it displays only numbers. Forward!
Useful links from the Professor — 19
Of course, looking at the same material from different angles is useful, because everyone thinks differently, and perhaps for you the best source of the theory will be different from the source best suited to your friend. And sometimes it's helpful to reread what we've already read. Today is one of those times. Let's reread the article about input/output streams.
Google’s secure data centers
Data is the most important modern asset. That’s why its security is a top priority for enterprises and service providers. Let’s see how Google secures data at one of the biggest data centers in the world. In this video, we’ll review the various levels of security with Joe Kava, Google’s VP of Data Center Operations.
Bonus task | Lesson 11 | Level 9
Captain Squirrels is on the phone! He has a couple of surprises for you. More precisely, not a couple, and they aren't surprises, but rather ten tasks to reinforce your knowledge about streams. They aren't the simplest, but they have a healthy effect on the brain (or CPUs, for those who have them). And if you tackle the bonus tasks, you'll get twice as much "XP"!