What is the difference between DataInputStream and
BufferedReader

Answers were Sorted based on User's Feedback



What is the difference between DataInputStream and BufferedReader..

Answer / 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

What is the difference between DataInputStream and BufferedReader..

Answer / rama

An important difference between the ...Stream classes and
the ...Reader/...Writer classes is that streams work with
binary data (in other words, raw bytes), while readers and
writers work with character data. In going from one to the
other there's always an encoding or decoding of data
involved.

The en-/decoding step can't be done in a meaningful way
unless one knows what encoding was used. Common encodings
are US-ASCII, UTF-8 and other Unicode variants, MacRoman,
ISO-8859-1 and CP1252. Furthermore, each platform (Windows,
Linux, OS X, ...) has its own default encoding, so if no
encoding is specified, the JVM will choose one - which may
well be the wrong one.

Is This Answer Correct ?    8 Yes 7 No

Post New Answer

More Core Java Interview Questions

Why ArrayList class is not a synchronized class and why it is not a thread safe class? explain

1 Answers  


What are different ways of object creation in java ?

0 Answers  


What is unicode?

1 Answers  


The following program is Overloading or Overriding? public class PolymorphismEx { public int sampleMethod(int a) { return a; } public String sampleMethod(int a) { return "Is it Overloading or Overriding???"; } }

4 Answers   Ness Technologies, TCS,


What are the common problems you have faced while implementing Java?

1 Answers   IBM,






IS method overriding is Duplication of Methods?

5 Answers   CybAge,


program to find 25 square = 625 here the 625 of last two digits is equal to 25, i don't know excatly what this type of number is called

1 Answers   Huawei,


Explain creating threads by implementing runnable class?

0 Answers  


When would you use a static class?

0 Answers  


please send code example of inner classes?

2 Answers  


What is a singleton in genetics?

0 Answers  


1).what is the difference between below examples String s="vijay"; String s=new String("vijay");

12 Answers   Mascon, Satyam, TCS,


Categories