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 is memory leak and how does java handle it?
What are the characteristics of Final,Finally and Finalize keywords.
What is singleton pattern?
Can we override static methods in java?
How many bits is a char?
what is the major difference between linkedlist and arraylist in java?
What is a treemap in java?
What is the difference between JDBC 1.0 and JDBC 2.0?
What is an object class?
explain different ways of using thread? : Java thread
Do we need to manually write Copy Constructor?
Can we make the abstract methods static in java?
When is the garbage collection used in Java?
Why enumeration is faster than iterator?
Is linked list a linear or non-linear data structure?