Scanner vs. BufferedReader

Scanner vs. BufferedReader

I have to decide from these two classes to read a file. File is of .txt type and its size is around 4.5 GB. There other text files also which is around 7 to 10 GB. So, which class is to be used to read the data?

Thanks

View Answers

February 14, 2015 at 6:15 PM

Hi,

Just to read the text file of big size you should use the BufferedReader class.

Check the details at What is the fastest way to read a file in Java?.

Thanks









Related Tutorials/Questions & Answers:
Scanner vs. BufferedReader
Scanner vs. BufferedReader  I have to decide from these two classes to read a file. File is of .txt type and its size is around 4.5 GB. There other... should use the BufferedReader class. Check the details at What is the fastest
BufferedReader
BufferedReader  What is BufferedReader used for?   BufferedReader read text from a character-input stream, buffering characters so... { BufferedReader in = new BufferedReader(new FileReader("C:/Hello.txt")); String line
Advertisements
Scanner
Scanner   Hi, I am facing a problem in the following code as what should be the while condition I should use in order to get the loop keep running...= "Celsius"; do { Scanner temp_ip= new Scanner(System.in
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
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
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
getResourceAsStream() vs FileInputStream
getResourceAsStream() vs FileInputStream  getResourceAsStream() vs FileInputStream
Bufferedreader example
Bufferedreader example Here we have provided the best links for Bufferedreader class examples. You can use Bufferedreader class for buffering while reading... of Bufferedreader class Bufferedreader tutorial Bufferedreader Thanks
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
websphere vs weblogic
websphere vs weblogic  websphere vs weblogic Why you are using websphere instead of weblogic
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
encapsulation vs abstraction
encapsulation vs abstraction  what is the difference between encapsulation and abstraction
oracle vs sql
oracle vs sql  what is the difference between oracle and sql
Scanner class
Scanner class  what have to do when an error occur about Scanner class.i code scanner sc=new Scanner(System.in); but it shows an error regarding this.   Use Scanner sc=new Scanner(System.in
compiler vs interpreter
compiler vs interpreter  "compiled program executes faster especially if the program contains loop" Why
Interface vs abstract class
Interface vs abstract class  Hai, Is there any possible to defining abstract methods in Interface
JETM vs Jprofiler
JETM vs Jprofiler  Can anyone explain the difference between Java Execution Time Measurement(JETM) and Jprofiler
ejb vs hibernate - EJB
ejb vs hibernate  1>>> If we have ejb entity bean why we need hibernate? 2>>> Is hibernate distributed
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
Scanner class
Scanner class  import java.util.*; class Dd { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int... Scanner class was introduced in java 5
Convert InputStream to BufferedReader
Convert InputStream to BufferedReader   ... Inputstream to Bufferedreader. The class ... from a input stream. java.io. BufferedReader class provides
scanner program
scanner program  a news paper boy purchase 100 papers every day.he purchases papers at Rs.1.50 and sells at Rs.2.00 at each.any unsold news papers... his profit..using scanner
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
ejbSelect() vs ejbHome() - EJB
ejbSelect vs ejbHome  Hi, 1) What are the differences between ejbSelect() and ejbHome...() business methods in CMP bean? 2) In Ed Romans Mastering EJB 3rd edition, it is mentioned that ejb finder methods
Derby vs MySQL - SQL
Derby vs MySQL  Hi, I want to know what are the advantages using Derby Database over MySQL.  http://www.roseindia.net/eclipse/plugins/database/index.shtml
inheritence Vs inheritence
inheritence Vs inheritence  what are difference b/w c++ inheritence and java inheritence   Hi Friend, C++ supports Multiple Inheritance while Java does not. Thanks
java vs vb
java vs vb  history of java and advanced products as well as vb? compared with java and vb? finalize list out the table of java and vb products? viewers i want more soon
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
java vs .net - Java Beginners
java vs .net  which language is powerful now java or .net
portability vs platform independent
portability vs platform independent  sir, pls tell me 1.the differences between platform independent and portability related to java technology 2.how java provides security 3.how can i prove servlet is a single instance
Scanner
without scanner
and class and didn't use the scanner .   Hi Friend,ADS_TO_REPLACE_1
ModuleNotFoundError: No module named 'conan_vs'
ModuleNotFoundError: No module named 'conan_vs'  Hi, My Python... 'conan_vs' How to remove the ModuleNotFoundError: No module named 'conan_vs... to install padas library. You can install conan_vs python with following
ModuleNotFoundError: No module named 'vs-emr'
ModuleNotFoundError: No module named 'vs-emr'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'vs-emr' How to remove the ModuleNotFoundError: No module named 'vs-emr'
ModuleNotFoundError: No module named 'vs-ip'
ModuleNotFoundError: No module named 'vs-ip'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'vs-ip' How to remove the ModuleNotFoundError: No module named 'vs-ip'
ModuleNotFoundError: No module named 'conan_vs'
ModuleNotFoundError: No module named 'conan_vs'  Hi, My Python... 'conan_vs' How to remove the ModuleNotFoundError: No module named 'conan_vs... to install padas library. You can install conan_vs python with following
doGet() Vs doPost()
doGet() Vs doPost()  plz explain the differences between both of these methods used in a servlet. also give an example of both the methods. thanks.   A doGet() method is limited with 2k of data to be sent, and doPost
Order of list in java Vs Haskell.
Order of list in java Vs Haskell.  How to order of [1,2,3] to [1,2,3,2,1]in java
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
PHP Comma vs Period - PHP
PHP Comma vs Period  Explain PHP Comma vs Period. And also how can one show a comma within a comma separated file.   Hi Friend, Please visit the following link: http://www.roseindia.net/tutorial/php/phpbasics/PHP
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
return 0 vs exit 0
return 0 vs exit 0  what is the difference between return 0 and exit 0 in c? i could not find any difference in their behaviour (both terminates the process execution) in a program
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
scanner - Java Beginners
scanner   how to ask user to enter index in arry using scanner
Hibernate Native vs Hibernate JPA
Hibernate Native vs Hibernate JPA  What is the difference between Hibernate Native vs Hibernate JPA?   Hibernate is ORM framework which you can use in your application. You can also use Hibernate as Persistence
ModuleNotFoundError: No module named 'scanner'
ModuleNotFoundError: No module named 'scanner'  Hi, My Python... 'scanner' How to remove the ModuleNotFoundError: No module named 'scanner... to install padas library. You can install scanner python with following command
ModuleNotFoundError: No module named 'scanner'
ModuleNotFoundError: No module named 'scanner'  Hi, My Python... 'scanner' How to remove the ModuleNotFoundError: No module named 'scanner... to install padas library. You can install scanner python with following command
data wrangling vs data cleaning
data wrangling vs data cleaning  Hi, I am beginner in Data Science... wrangling vs data cleaning Try to provide me good examples or tutorials links so that I can learn the topic "data wrangling vs data cleaning". Also
data wrangling vs data mining
data wrangling vs data mining  Hi, I am beginner in Data Science... wrangling vs data mining Try to provide me good examples or tutorials links so that I can learn the topic "data wrangling vs data mining". Also tell me

Ads