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
posted
0
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
posted
0
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.