Presentation is loading. Please wait.

Presentation is loading. Please wait.

JAVA IO.

Similar presentations


Presentation on theme: "JAVA IO."— Presentation transcript:

1 JAVA IO

2 Introduction

3 Java Streams

4 Streams Java reads and writes data via streams
A stream is a sequence of data (bytes, characters, etc… We read data from input streams We write data to output streams

5 Byte Streams The FileInputStream and FileOutputStreams read and write a sequence of bytes The read() method reads a byte The write() method writes a byte The close() method closes the file

6 Byte Streams (Example)

7 Character Streams Character streams work the same way as byte streams but operate on 16 bit Unicode characters The FileReader and FileWriter read and write a sequence of bytes The read() method reads a character The write() method writes a character

8 Web Example The InputStream class is the base class for all readers
But we want to read characters which is done via the InputStreamReader So we wrap the classes

9 Web Example


Download ppt "JAVA IO."

Similar presentations


Ads by Google