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


Please Help Members By Posting Answers For Below Questions

What is thread life cycle in java?

586


Give an example of use of pointers in java class.

563


Does list allow duplicates in java?

522


What are the four corner stones of oop?

547


How to optimize the javac output?

602






What are pass by reference and pass by value?

529


Explain about the select method with an example?

591


Why do we need hashmap in java?

559


What are the new features in java 8? Explain

561


What are the steps involved to create a bean?

685


What is an infinite loop?

548


What is string substring?

563


Which collection allows duplicate values in java?

546


Can you tell me range of byte?

562


how come we know the object is no more used in the class?

5435