java.io package.
At the top level are InputStream and OutputStream. InputStream is an abstract class representing an input stream of bytes. This class has a number of methods, the most important of which are a number of overloaded read methods. OutputStream is an abstract class representing a output stream of bytes. This class has a number of methods, the most important of which are a number of overloaded write methods. A number of specialized classes are inherited from InputStream and OutputStream that override their parent methods to handle specific I/O implementations, for example, files or pipes. Figures 1 and 2 also show a number of subclasses of FilterInputStream and FilterOutputStream. These filter streams add functionality to existing streams, for example, providing buffering or letting an application read or write primitive Java data types. Similar to InputStream and OutputStream classes are the Reader and Writer classes. However, these are abstract classes that represent input and output streams of characters rather than bytes.
Figure:1: InputStream hierarchy
Figure:2: OutputStream hierarchy
Figure:3: Reader Hierarchy
Figure:4: Writer Hierarchy
No comments:
Post a Comment