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
What are runtime exceptions?
Explain the protected field modifier?
Are strings immutable in java?
What is e in java?
Explain heap sort?
What are the 4 types of characters?
What is the difference between integer parseint and integer valueof?
what is function overloading in java?
Can we create an object of static class in java?
What is a short in java?
Why do we need hashmap in java?
What is difference between fileinputstream and filereader in java?
What is meant by main method?
Why is serialization required?
What are controls and their different types in awt?