Profile
Join date: Apr 12, 2022
About

Java Tutorial: I/O Packages

In java Input/output (I/O) is present in java.io package. This package contains large number of classes which support input and output operation. These classes in the package are primarily abstract classes. The input/output is stream oriented.

Read: https://studydaddy.com/

For reading the stream :

• Open the stream • Read information • Close the stream

For writing in stream : • Open the stream • Write information • Close the stream

There are two types of stream as follows: 1. Byte stream 2. Character stream 1. Byte Streams:

According to homework answers websites it supports 8-bit input and output operations. There are two classes of byte stream

InputStream:

This class is used for reading data like byte and array from an input source. Input source can be a file, String or any memory that contains data. Inputstream is an abstract class which defines the programming interface for all input streams that are inherited from it. Inputstream is automatically opened when it is created. It can explicitly be closed using close() method.

OutputStream:

This class is used for writing data like byte and array to an output source. Output source can be anything such as file, String or any memory that contains data. Outputstream is an abstract class which defines the programming interface for all output streams that are inherited from it. Outputstream is also automatically opened when it is created. It can explicitly be closed using close() method.

More: https://studydaddy.com/geometry-homework-help

2. Character Streams:

Character stream supports 16-bit Unicode character input and output. There are two classes of character stream as follows: 1. Reader 2. Writer

These classes allow internationalization of Java I/O and text is stored in international character encoding.


More resources:

Exception Handling

String in Java

Java Tutorial: Abstract Class

Tokens in Java

Java Tutorial: Data Types

m
millerwilliee
More actions