Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes BufferedReader?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "BufferedReader??" Watch "BufferedReader??" New topic
Author

BufferedReader??

rikstar
Greenhorn

Joined: Sep 02, 2001
Posts: 6
How do I create a buffered reader and how do I use them???
Cheers,
Rikstar
Terence Doyle
Ranch Hand

Joined: May 30, 2001
Posts: 328
HI,
Basic Explanation
A BufferedReader is a "high-level" reader, that is it can't connect directly to a file or input stream. It is used to make more efficient use of low-level readers because they only read in bytes and chars whereas a BufferedReader can read Strings with the readLine() method. It also has some utility methods like skip(), reset() etc.
The code below demonstrates searching a file for a string - it could be a list of passwords or something -. To make this work create a file called "MyFile.dat" in notepad and write a word or words on some lines. one of the lines should contain just "hello" (without the inverted commas). Put this file in the same directory as the BuffRead file.

Hope that helps,
------------------
Terry Doyle
Sun Certified Programmer for Java 2 Platform
[This message has been edited by Terence Doyle (edited October 10, 2001).]


Raising Flares debut album 'Ignition' out now

http://www.raisingflares.com

Terry Doyle <br />SCPJ 1.4 , SCWCD , SCMAD(Beta)
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
rikstar,
I have asked you to change your ID before. Please change your name to be compliant with JavaRanch's naming policy.
Your ID should be 2 separate names with more than 1 letter each. We really want this to be a professional forum and would prefer that you use your REAL name.
Thanks,
Cindy

"JavaRanch, where the deer and the Certified play" - David O'Meara
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: BufferedReader??
 
Similar Threads
Assert stmt in Eclipse
Dynamic Data Types in Eclipse
Adding oci804jdbc.dll to java library path
JUnit and Cactus using strutstestCase
printing on an applet