Java Files and I/O

it needs package containers .All these streams represent an input source and an output destination.
A stream can be defined as a sequence of data there are two kinds of streams
InputStream:It is used to read data from a source
OutputSTream:It is used for writing data o a destination

Here is a hierarchy of classes to deal with Input and Output streams:
Java I/O StreamsThe two important streams are FileInputSTrea and FileOutputSTream which would be discussed in this tutorial:
Following constructor will create a input stream object to read the file:

Once you have InputStream object in hand,  then there is a list of helper methods which can be used to read to stream or to do other operations on the stream.

And there is OutPutStream that can be discussed later.It is almost same like:

And there are some other class for filereading and writing and creating directories.

Byte stream:

Character Streams:

Standard Streams:
Standard Input:
Standard Output: System.out
Standard Error: System.err
example to demonstrate inputstream and outputstream: