Sunday, 4 December 2016

Java - Streams

Streams:-
        It is a flow of data.
        It is a path of communication between source and destination.
2 Types
        1) Byte Oriented Stream (ASCII Code format)
        2) Character Oriented Stream (Unicode format)
Byte Oriented Stream
InputStream:
        To read the data from particular i/p device such as keyboard,file and socket.
OutputStream:
        To write the data to the particular o/p device such as monitor,file and socket.
classes:-
1) OutputStream
        It is an abstract class and it is the super class for all the byte-oriented o/p stream classes.
methods:-
public void write(int);
public void write(byte[]);
public void write(byte[],int offset,int length);
public void flush();//clear the stream.
public void close();
2) InputStream
        It is an abstract class and it is the super class for all the byte-oriented i/p stream classes. It is used to read the data from particular i/p device.
methods:-
public int read();
public int read(byte[]);
public int read(byte[],int offset,int length);
public long skip(long);
public long available();

public void close();

No comments:

Post a Comment

Featured post

Development Of JAVA Program