SSC1: Introduction to Input/Output - Volker Sorge
This page contains some resources for the section on Input/Ouput.
Lecture Notes
Here are the slides and the lecture notes. The notes are more printer friendly and
are a superset of the slides.
Code Examples
The following are some simple code examples that work with basic input/output
techniques. You can import them into your IDE, but it is easiest to simply
compile and run them on the command line of your shell.
- io1.java: A simple byte stream example.
- io2.java: A slightly more complex byte stream example.
- io3.java: A character stream example.
- io4.java: A data stream example for integer data.
- io5.java: A very simple object stream example with BigDecimals.
- mix.java: Mixing byte and data streams.
- printInt.java: Creates an ASCII file using the PrintWriter class.
- formatInt.java: Creates an ASCII file using the Formatter class.
- addInt.java: Collects integers from a given ASCII file and computes their sum.
- partition.java: Paritions integers from a file according two keywords and computes
the sum for both partitions.
- bio2.java: A buffered byte stream example.
- bio3.java: A buffered character stream example.
- bio4.java: A data stream example for integer data using buffered streams.
- bio5.java: A very simple object stream example with BigDecimals using buffered streams.
Last modified: Sun Oct 25 16:05:00 CET 2009