What is the difference between DataInputStream and
BufferedReader
Answer Posted / a
The DataInputStream works with the binary data, while the
BufferedReader work with character data.
All primitive data types can be handled by using the
corresponding methods in DataInputStream class, while only
string data can be read from BufferedReader class and they
need to be parsed into the respective primitives.
DataInputStream is a part of filtered streams, while
BufferedReader is not.
DataInputStream consumes less amount of memory space being
it is binary stream, where as BufferedReader consumes more
memory space being it is character stream.
The data to be handled is limited in DataInputStream, where
as the number of characters to be handled has wide scope in
BufferedReader.
| Is This Answer Correct ? | 28 Yes | 1 No |
Post New Answer View All Answers
Why is stringbuffer not immutable?
What is join () in java?
What are the types of java?
Can a vector contain heterogenous objects?
Can we override compareto method?
Does constructor creates the object ?
Is simpledateformat safe to use in the multithreaded program?
What about abstract classes in java?
Is alive method in java?
How do you achieve polymorphism in java?
Explain about anonymous inner classes in java?
Explain the use of volatile field modifier?
Is string is a keyword in java?
What is the char data type?
Which is fastest collection in java?