Home : Course Map : Chapter 9 : Java :
Chapter 9 : Input - Output
JavaTech
Course Map
Chapter 9

Introduction
Overview
Streams
Wrappers,Buffers
Console I/O
  Text Output 
     Demo 1

  Formatter/printf()
     Demo 2

  Tex 2t Input
     Demo 3

  Scanner
     
Demo 4
File Class
  File I/O
  File Output-Text
     Demo 5

  Formatter to File
     Demo 6

  File Input - Text
    Demo 7

  Scanner - Files
     Demo 8

  File I/O - Binary
     Demo 9
   Demo 10
File Chooser Dialog
  Demo 11

Character Codes
  Demo 12
   Demo13
Object I/O
Types to Bytes
Stream Filters
Other I/O Topics
Exercises

    Supplements
Character I/O
  Demo 1   Demo 2
Random Access
  Demo 3
ZIP/GZIP Streams
  Demo 4
Piped Streams
  Demo 5
NIO Framework
More NIO
  Demo 6

     About JavaTech
     Codes List
     Exercises
     Feedback
     References
     Resources
     Tips
     Topic Index
     Course Guide
     What's New

Java I/O provides a very powerful and adaptable set of tools. The designers sought to devise a general set of classes and methods that you can combine in different ways to attack different kinds of I/O tasks.

For example, whether one reads from the keyboard, from a local file, or from a file over the internet, the stream of data will look the same to a high level read method.

However, Java I/O is complicated. Just doing something as basic as writing data to a file can involve the instantiation of two or three classes. That is why we avoided Java I/O, other than System.out.println(), until now. (An approach of some books is to provide a set of custom tools for basic I/O that are simple to use.)

This introduction to Java IO provides the following:

  • Overview of Java I/O
  • Stream - the essential concept in Java I/O.
  • Wrappers - add capabilities to a stream class by wrapping it with a higher level class.
  • Console I/O provides useful interaction with applications.
    • Text output
    • Formatter and System.out.printf() - J2SE5.0 brings a new class and method for formatted numerical output
    • Text input
    • Scanner - the new class in J2SE5.0 for formatted input.
  • File Class - this class provides an identifier for a file.
    • File I/O - the stream classes for reading/writing with files.
    • Text output to a file - writing/reading characters to files
    • Formatter output to a file
    • Text input from a file
    • Scanner input from a file
    • File I/O - Binary - writing/reading binary data.
  • Character encoding
  • Object I/O
  • Converting primitive types to bytes and back
  • Sources, destinations, and filters
  • File Chooser Dialog - browse local directories with a JFileChooser.
  • Other I/O Topics - brief look at other IO classes
  • Exercises

 

 

Latest update: Nov. 10, 2004

              Tech
Histogram I/O
Hist I/O - Get/Set
  Demo 1
Hist I/O - Objects
  Demo 2
HistogramStream
  Demo 3
Filtering Data
  Demo 4
Exercises

           Physics
Physics Model
Simulation Design
Physics Simulator
  Demo 1
Experiment Design
Experiment Sim.
  Demo 2
Analysis
Expt. + Analysis
  Demo 3
Exercises

  Part I Part II Part III
Java Core 1  2  3  4  5  6  7  8  9  10  11  12 13 14 15 16 17
18 19 20
21
22 23 24
Supplements

1  2  3  4  5  6  7  8  9  10  11  12

Tech 1  2  3  4  5  6  7  8  9  10  11  12
Physics 1  2  3  4  5  6  7  8  9  10  11  12

Java is a trademark of Sun Microsystems, Inc.