Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


samar
Java DataInputStream
1 Answer(s)      4 years and 2 months ago
Posted in : Java Interview Questions


What is the difference between DataInputStream and BufferedReader

Advertisement
View Answers

October 30, 2010 at 10:28 AM


Hi,

Here is the answer,

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.

Thanks.



Related Tutorials/Questions & Answers:
Java DataInputStream
Java DataInputStream   What is the difference between DataInputStream and BufferedReader
Java file DataInputStream
Java file DataInputStream This section demonstrates you the use of DataInputStream class. The class DataInputStream allows to read primitive Java data types... example, we have created an instance of DataInputStream class which wraps
Advertisements
Java Read File Line by Line - Java Tutorial
to write java program to read file line by line. We will use the DataInputStream... Java Read File Line by Line - Example code of reading the text file in Java one line at a time     
Java read file
There are many ways to read a file in Java. DataInputStream class is used to read text File line by line. BufferedReader is also used to read a file in Java when the file in huge. It is wrapped around FileReader. Java supports reading
java
java  how to get values using datainputstream in java
java parsing of data types
java parsing of data types  Why its not works? char ch; String s=* ch=Character.parseChar(s) program: char op; DataInputStream dis=new DataInputStream(System.in); System.out.print("Enter operator (+,-,*,/,%): "); op
programming - Java Beginners
, the DataInputStream class is used to read binary Java primitive data types in a machine...Java Programming - Getting the input from the keyboard   I need a Java program to take a input from the keyword.  For getting the input
ask - Java Beginners
"); // Get the object of DataInputStream DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new...://www.roseindia.net/java/ Thanks. Amardeep
different type input in java
type like as DataInputStream,Scanner i want to get source code of these all type of input method. thank   Java Read through DataInputStream: import...[] args) throws Exception{ DataInputStream in = new DataInputStream
BufferReader example in Java
. What is DataInputStream ? From reading java data types from a input stream in a machine independent way, we incorporate DataInputStream. Example Read line... FileInputStream, DataInputStream, BufferedReader. What is BufferedReader ? BufferedReader
java program - Java Beginners
java program  sir,i'm asked to write a program in java on below question. Design a java interface for ADT stack.Develop two different class... = -1; public void push() { try { DataInputStream dis = new
java programs - Java Beginners
java programs  design a java interface for adt stack .develop two...[] = new int[n]; int top = -1; public void push() { try { DataInputStream dis = new DataInputStream(System.in); System.out.println("Enter Element"); int
java - Java Beginners
java  design a java interface for adt stack----its is one of lab...; public void push() { try { DataInputStream dis = new DataInputStream(System.in... arg[]) throws IOException { DataInputStream dis = new DataInputStream(System.in
java - Java Beginners
java  "Design a Java interface for ADT Stack. Develop two different...]; int top = -1; public void push() { try { DataInputStream dis = new DataInputStream(System.in); System.out.println("Enter Element"); int ele
java - Java Beginners
java  Design a Java interface for ADT Stack. Develop two different...; public void push(){ try{ DataInputStream dis=new DataInputStream(System.in...{ DataInputStream dis=new DataInputStream(System.in); StackImplementation stk=new
Java Strings problem - Java Interview Questions
Java Strings problem  How can you find a word which is repeating in maximum number of times in document, which is in text format in java?  ... of DataInputStream DataInputStream in = new DataInputStream(fstream
code problem - Java Beginners
a file that contains the following lines- java java script j2ee php sql... be changed in to "j2me". and new file containt would be like this- java java script j2ee j2me sql plz help me to sort out this problem. thnx  
code problem - Java Beginners
of DataInputStream DataInputStream in = new DataInputStream(fstream... in Java visit to : http://www.roseindia.net/java/example/java/io/ Thanks
To convert Html to pdf in java - Java Beginners
html file to pdf file using java. can any one help me out. Thanks & Regards..."); FileInputStream fis = null; BufferedInputStream bis = null; DataInputStream dis...); dis = new DataInputStream(bis); String st=""; while (dis.available() != 0
java - Java Beginners
java  write a java application to open the file & display...; BufferedInputStream bis = null; DataInputStream dis = null; String data... BufferedInputStream(fis); dis = new DataInputStream(bis); while (dis.available
Java
Java  how to upload file in jsp?   JSP upload file 1)page.jsp: <%@ page language="java" %> <HTML> <HEAD><TITLE>...("multipart/form-data") >= 0)){ DataInputStream in = new DataInputStream
programming - Java Beginners
looking for a sample code to list all even numbers between two numbers in JAVA. Thanks!  Program to list all even numbers between two numbers in JAVA... void main(String[] args){ try{ DataInputStream d=new DataInputStream(System.in
ADT stack - Java Beginners
ADT stack  Design a Java interface for ADT Stack. Develop two... { DataInputStream dis = new DataInputStream(System.in); System.out.println("Enter Element... IOException { DataInputStream dis = new DataInputStream(System.in
FileHandling - Java Beginners
FileHandling  Q. Write a java prg which accepts a list of existing...); DataInputStream in = new DataInputStream(fstream); BufferedReader br = new...); FileInputStream fstream1 = new FileInputStream(file1); DataInputStream in1 = new
java - Design concepts & design patterns
java  design a java interface for ADT stack.develop two differant... int[n]; int top = -1; public void push() { try { DataInputStream dis = new DataInputStream(System.in); System.out.println("Enter Element
Java Stack ADT
Java Stack ADT You all are familiar with the data structure 'Stack'. The Stack... the only element that can be inspected. Here we have designed a Java interface for ADT... top = -1; public void push() { try { DataInputStream dis = new
java test
java test  How to read the data from an .csv file and write into an xml file using java? (test_sample.csv(it should contain at least 39 lines)) i..."); // DataInputStream br= new DataInputStream(fStream); String s=null
JAVA - Java Beginners
JAVA  Write a Java program to read a file that contains DNA sequences of arbitrary length one per line  Hi Friend, Try the following..."); DataInputStream in = new DataInputStream(fstream); BufferedReader br = new
Java - Java Beginners
Java  1.Write a Java program to read a file that contains DNA sequences of arbitrary length one per line (note that each DNA sequence is just...:/school.txt"); DataInputStream in = new DataInputStream(fstream
Java
)){ DataInputStream in = new DataInputStream(request.getInputStream()); int formDataLength
java a - Java Beginners
java a  i will ask iam using servlets ,in one program my...") >= 0)) { DataInputStream in = new DataInputStream(request.getInputStream...)) { DataInputStream in = new DataInputStream(request.getInputStream()); int
 

 

 

DMCA.com