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 memory leak and how does java handle it?

598


What are the characteristics of Final,Finally and Finalize keywords.

795


What is singleton pattern?

647


Can we override static methods in java?

662


How many bits is a char?

623






what is the major difference between linkedlist and arraylist in java?

639


What is a treemap in java?

639


What is the difference between JDBC 1.0 and JDBC 2.0?

2799


What is an object class?

651


explain different ways of using thread? : Java thread

648


Do we need to manually write Copy Constructor?

685


Can we make the abstract methods static in java?

672


When is the garbage collection used in Java?

743


Why enumeration is faster than iterator?

618


Is linked list a linear or non-linear data structure?

637