(17) Java IO

(17) Java IO - Input and output CMSC 132: Object-Oriented...

Info iconThis preview shows pages 1–2. 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 2 Input and output Approaches to storing file data Text files Data is represented in human-readable form Example: Java source programs Use a text editor to manipulate the data Binary files Data is represented in binary form Binary files are more compact in terms of memory space Binary files are designed to be read by programs They're more efficient to process (encoding and decoding of data is not required) 3 Input and output , con't. Internally all files are stored in binary format Text I/O provides a level of abstraction to encode/decode characters There are several Java I/O classes relying on java.io.* I/O classes can be categorized by whether they perform input or output, and whether they deal with text or binary data An input object (input stream) reads a stream of data from a file An output object (output stream) writes a stream of data to a file 4 InputStream
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

(17) Java IO - Input and output CMSC 132: Object-Oriented...

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

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