JAVA IO STREAMS
Streams
Java programs perform I/O operations through streams. A stream is a sequence of data. It is an abstraction that either produces
or consumes information. A stream is linked to a physical device by the Java I/O
system. All streams represent an input source and an output
destination and they behave in the same manner, even if
the actual physical devices to which they are linked differ.
Byte Streams
and Character Streams
Java defines two types of streams: byte streams and character streams.
Byte streams are used for handling binary data. Character streams are used for
handling input and output of characters in Unicode.
IO STREAM
Byte streams
Byte streams are defined using two class hierarchies. At the top are two
abstract classes InputStream and OutputStream. These two classes have several subclasses to handle
different types of physical devices such as disk files, network connections,
memory buffers etc., The most important methods of these classes are read() and
write() for reading and writing bytes of data.
Character
streams
Character streams are defined using two class hierarchies. At the top
are two abstract classes Reader and Writer. These two classes handle
Unicode character streams. The most important methods of these classes are
read() and write() for reading and writing characters of data
CHARACTER
STREAM
No comments:
Post a Comment
Don't be a silent reader...
Leave your comments...
Anu