19JavaIO - CMSC 132: Object-Oriented Programming II Java...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CMSC 132: Object-Oriented Programming II Java I/O Overview Department of Computer Science University of Maryland, College Park
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Input/Output Approaches to store file data Text files Data represented in human-readable form Example: Java source programs Use text editor to manipulate the data Binary files Data represented in binary form Designed to be read by programs More compact More efficient to process (no encoding/decoding required) Keep in mind all files are stored in binary format Text I/O provides a level of abstraction to encode/decode characters
Background image of page 2
3 Input/Output Several Java I/O classes Relying on java.io.* I/O classes can be categorized in input/output classes and whether they deal with text or binary data Input Object (Input Stream) Object reads a stream of data from a file Output Object (Output Stream) Object writes a stream of data to a file
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Input/Output InputStream class – abstract superclass of all classes representing an input stream of bytes OuputStream class – abstract superclass of
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

19JavaIO - CMSC 132: Object-Oriented Programming II Java...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online