epubjs
Version:
Render ePub documents in the browser, across many devices
17 lines (16 loc) • 2.36 kB
HTML
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 12. Input/Output Facilities</title><link rel="stylesheet" href="core.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"/></head><body><div class="chapter" title="Chapter 12. Input/Output Facilities"><div class="titlepage"><div><div><h1 class="title"><a id="learnjava3-CHP-12"/>Chapter 12. Input/Output Facilities</h1></div></div></div><p>In this chapter, we continue our exploration of the Java API by
looking at many of the classes in the <a id="I_indexterm12_id750670" class="indexterm"/><code class="literal">java.io</code> and <a id="I_indexterm12_id750680" class="indexterm"/><code class="literal">java.nio</code> packages. These
packages offer a rich set of tools for basic I/O and also provide the
framework on which all file and network communication in Java is
built.</p><p><a class="xref" href="ch12s01.html#learnjava3-CHP-12-FIG-1" title="Figure 12-1. author="pat” timestamp="20121117T215954-0600” comment="I think this originally came from the nutshell book. Do they have an update for this diagram that we could use? (Maybe one for NIO?)”The java.io package">Figure 12-1</a> shows the class hierarchy
of these packages.</p><p>We’ll start by looking at the stream classes in <code class="literal">java.io</code>, which are subclasses of the basic
<code class="literal">InputStream</code>, <code class="literal">OutputStream</code>, <code class="literal">Reader</code>, and <code class="literal">Writer</code> classes. Then we’ll examine the <code class="literal">File</code> class and discuss how you can read and write
files using classes in <code class="literal">java.io</code>. We also
take a quick look at data compression and serialization. Along the way,
we’ll also introduce the <code class="literal">java.nio</code>
package. The NIO, or “new” I/O, package (introduced in Java 1.4) adds
significant functionality tailored for building high-performance services
and in some cases simply provides newer, better APIs that can be used in
place of some <code class="literal">java.io</code> features.</p></div></body></html>