Difference between DataInputStream and BufferedReader

Difference between DataInputStream and BufferedReader

The differences are:

- 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.

Difference between throw and throws - Java
The throw key word is used to explicitly throw an exception, while throws is utilized to handle checked exceptions for re-intimating the compiler that exceptions are being handled...
Explain the ways to serialize the java object
Object serialization could be used in different ways: - Simple persistence of the object...
Similarities between an array and an ArrayList - Java
The following are the similarities between an array and an ArrayList: - Both array and ArrayList can have duplicate elements in them...
Post your comment