Monday, April 25, 2011

Type of Steams in java (reflected in java.io class hierarchy )

The java.io package contains classes that perform input and output. In Java, I/O classes are differentiated according to the type of data being read or written. Byte oriented and numeric data is written with output streams and read with input streams. Character data, that is text, is written with writers and read with readers. Whether you use streams or readers and writers depends on the type of data you're dealing with. All text data, especially non-ASCII text, should be passed through a reader or writer.
The two main stream classes are java.io.InputStream and java.io.OutputStream. The two main reader and writer classes are java.io.Reader and java.io.Writer These are abstract base classes for many different subclasses with more specialized abilities.

No comments:

Post a Comment

Chitika