Scanner vs. BufferedReader

Ads
 

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

Ads









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... IOException { BufferedReader in = new BufferedReader(new FileReader("C:/Hello.txt
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
getResourceAsStream() vs FileInputStream
getResourceAsStream() vs FileInputStream  getResourceAsStream() vs FileInputStream
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
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
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
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  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
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
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
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
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
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
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
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
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 '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'

Ads