Friday, January 14, 2011

Java's Streams

Streams are sequences of data flowing from source to destination. The source can be a keyboard, file, browser to a destination like monitor, browser, file and printer.

Streams are in two types: bytes and character streams. Byte streams are used to input and output 8 bits and character streams are for 16 - bit character data.

To read a stream:

  1. Open  a stream from a data source;
  2. Read the available data;
  3. Close the stream.
To write a stream:

  1. Open  a stream  to a  data source;
  2. Write the stream to a data source;
  3. Close the stream.

No comments: