BufferedReader

Ads
 

BufferedReader

What is BufferedReader used for?

View Answers

March 31, 2011 at 11:03 AM

BufferedReader read text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines. It can read data from the file and console.

Here is an example:

import  java.io.*;
class BufferedReaderExample{
    public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new FileReader("C:/Hello.txt"));
    String line="";
    while((line = in.readLine()) != null){
    System.out.println(line);
    }
    in.close();
  }
}

Ads









Related Tutorials/Questions & Answers:
BufferedReader
BufferedReader  What is BufferedReader used for?   BufferedReader read text from a character-input stream, buffering characters so... IOException { BufferedReader in = new BufferedReader(new FileReader("C:/Hello.txt
Java bufferedreader
bufferedreader class? How bufferedreader can be used to read a file? Thanks   In Java the BufferedReader class is used to read the stream successfully with buffering. The BufferedReader class provides efficient reading from the input
Advertisements
Read bufferedreader
Read bufferedreader  Tell me the example of Read file using bufferedreader. Thanks   Read the tutorial Reading file using BufferedReader class. Thanks
About BufferedReader
About BufferedReader   I have created FileInputStream fstream..."); DataInputStream in = new DataInputStream(fstream); BufferedReader bfr = new BufferedReader(new InputStreamReader(in)); for(int i=0;i<10;i++) { String Str
Why bufferedreader is used in java?
Why bufferedreader is used in java?  Hi, What is the use of BufferedReader class in Java? why bufferedreader is used in java? It will be great if anyone can give me the example code of BufferedReader class in java. Thanks
Scanner vs. BufferedReader
should use the BufferedReader class. Check the details at What is the fastest
convert it to BufferedReader class
convert it to BufferedReader class  import java.util.*; public class method { static Scanner console = new Scanner (System.in); public static...; double average; BufferedReader br=new BufferedReader(new InputStreamReader
BufferedReader in java
BufferedReader in java In this section you will learn about BufferedReader..., this class contain BufferedReader under the package java.io.BufferedReader...., it is advisable to use BufferedReader . BufferedReader br = new BufferedReader(new
Java IO BufferedReader
Java IO BufferedReader In this section we will discuss about the BufferedReader class in Java. BufferedReader class in java.io package is used for read... be specified. In most of the purposes default size of buffer is used. BufferedReader
Convert InputStream to BufferedReader
Convert InputStream to BufferedReader   ... Inputstream to Bufferedreader. The class ... a input stream. java.io. BufferedReader class provides efficient way
BufferedReader in Java
BufferedReader in Java BufferedReader in Java is used to to read characters.... BufferedReader class in Java is also used to read the data in buffer. Here we will show how to read line by line data from a file using BufferedReader
what is the default buffer size for bufferedreader
is the default buffer size for bufferedreader? Is there any example of reading the big... of the BufferedReader class is 8192 chars, which is sufficient for general programming
How To Read File In Java with BufferedReader
How To Read File In Java with BufferedReader class - example code This tutorial shows you how you can read file using BufferedReader class in your program. This tutorial is using the BufferedReader class for reading simple text file
What is the use of BufferedReader in Java program?
Learn about BufferedReader class and understand "What is the use of BufferedReader in Java program?" In this article I will explain you the benefits and uses of BufferedReader class in Java. In Java there are classes for reading
How to Read a file line by line using BufferedReader?
How to Read a file line by line using BufferedReader?  Hello Java... and found that BufferedReader can be used. So, help me and let's know How to Read a file line by line using BufferedReader, efficiently and using less memory
Java File Writing Example
the fileWriter object to the BufferedReader constructor. and write some data... location as roseindia/file.txt"); BufferedReader br=new BufferedReader(new... File Data"); BufferedReader bufferedData=new BufferedReader(new
Java read file
to read text File line by line. BufferedReader is also used to read a file in Java.... FileInputStream is used for reading streams of raw bytes. BufferedReader BufferedReader class read text from a character-input stream rather than read one
Java Read File Line by Line - Java Tutorial
and BufferedReader classes. This example of reading file is efficient and can... the BufferedReader class to read the data from stream line by line, application... line at a time. In the following example code we have used the BufferedReader
java code
java code  what is meaning bufferedreader
java code
java code  what is meaning bufferedreader
BufferReader example in Java
Read File Line by line using BufferedReader       Read File Line by line using BufferedReader... BufferedReader. In this section, we provide you two examples: 1. Read line
i am unable to identify the error in my code
i am unable to identify the error in my code  class Program { public static void main(String[] args) { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("enter
i am unable to identify the error in my code
i am unable to identify the error in my code  class Program { public static void main(String[] args) { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("enter
.bad file
.bad file  hi how can end this while dose not terminated Runtime r = Runtime.getRuntime(); Process p = r.exec("Run.bat"); BufferedReader reader = new BufferedReader(new InputStreamReader(new
.bat file
.bat file  hi how can end this while dose not terminated Runtime r = Runtime.getRuntime(); Process p = r.exec("Run.bat"); BufferedReader reader = new BufferedReader(new InputStreamReader(new
java - Java Beginners
[]) throws i/oException { BufferedReader br=new BufferedReader (new... static void main(String args[]) throws IOException { BufferedReader br=new BufferedReader (new InputStreamReader(System.in)); System.out.println("enter a char
prime number
prime number  HI!I want a java program that accepts a number from user and displays whether it is a prime number or not using BufferedReader
i/o streamas
i/o streamas  java program using bufferedreader and bufferedwriter   Hi Friend, Try the following code: import java.io.*; class... IOException { BufferedReader in = new BufferedReader(new FileReader("C
about predefine classes.....
....pls help like below code is given in program of palindrome BufferedReader object = new BufferedReader( new InputStreamReader(System.in)); here what is the work of BufferedReader class and InputStreamReader...... pls tell
please tell me
main(String ar[]) throws IOException{ BufferedReader br = new Bufferedreader...: cannot find symbol symbol : class Bufferedreader location: class SString BufferedReader br = new Bufferedreader(new InputStreamReader(System.in
please explain this prog
{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in... br.readLine() of BufferedReader class reads the input from the console

Ads