Java - IO Streams
Q. What is a stream and what are the types of Streams and classes of the Streams?
Ans: A Stream is an abstraction that either produces or consumes information. There are two types of Streams
and they are:
Byte Stream: Provide a convenient means for handling input and output of bytes.
Character Stream: Provide a convenient means for handling input & output of characters.
Byte Streams classes: Are defined by using two abstract classes, namely InputStream and OutputStream.
Character Streams classes: Are defined by using two abstract classes, namely Reader and Writer.
Q.What is the difference between Reader/Writer and InputStream/Output Stream?
Ans: The Reader/Writer class is character-oriented and the InputStream/OutputStream class is byte-oriented.
Q. What is an I/O filter?
Ans: An I/O filter is an object that reads from one stream and writes to another, usually altering the data in some
way as it is passed from one stream to another.
Q.What is serialization and deserialization?
Ans: Serialization is the process of writing the state of an object to a byte stream.
Deserialization is the process of restoring these objects.
Leave a Reply
You must be logged in to post a comment.