Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

faster method of reading an entire file than .readLine()

807603Dec 7 2007 — edited Dec 9 2007
Hi,

Is there a faster way of reading in an entire file than the method I am currently reading
BufferedReader allData10 = new BufferedReader(new InputStreamReader    
	 (new FileInputStream(new File(locy)),"UTF8"));  
	 
       String combine = "";
       String S;
       System.out.println("getO2");
       while ((S = allData10.readLine()) != null ){
    	 combine +=  (S +"\n");   	  
	       }
I don't need to read a line at a time, so wondering if this can be vastly improved.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 6 2008
Added on Dec 7 2007
15 comments
464 views