Results 1 to 3 of 3
- 11-12-2010, 07:22 PM #1
Member
- Join Date
- Nov 2010
- Posts
- 1
- Rep Power
- 0
Reading part of file with BufferedReader
Hi,
I'm trying to write a function that grabs a certain part of a file, sends that to another function, then continue to do the same thing from where the BufferedReader left off until the end of the file but can't seem to figure out how to make it work.
Here is what I have:
Can someone help me with this and explain what I'm doing wrong? Much would be appreciatedJava Code:String str = ""; int count = 0; try { while(read through the entire file...){ fileReader.reset(); while ((count < 4)){ str += fileReader.read(); count++; } fileReader.mark(1000); DoSomething(str) // send str to another function and do something with it; } } catch (IOException e) { // TODO Auto-generated catch block }Last edited by mattgavin; 11-12-2010 at 07:35 PM.
- 11-13-2010, 12:51 AM #2
Senior Member
- Join Date
- Feb 2010
- Location
- Waterford, Ireland
- Posts
- 748
- Rep Power
- 4
1st. atleast try to solve your problem (you know exactly what I mean)
2nd. maybe this Random Access Files (The Java™ Tutorials > Essential Classes > Basic I/O)
- 11-13-2010, 02:44 AM #3
Senior Member
- Join Date
- May 2010
- Posts
- 436
- Rep Power
- 4
Similar Threads
-
Reading part of a line in a text file
By aaronfsimons in forum New To JavaReplies: 3Last Post: 05-04-2009, 07:57 AM -
Reading a file from Applet (BufferedReader)
By Java Tip in forum Java TipReplies: 1Last Post: 06-22-2008, 10:51 PM -
Reading file contents (BufferedReader)
By Java Tip in forum Java TipReplies: 0Last Post: 02-07-2008, 09:00 AM -
Reading text from a URL using BufferedReader
By Java Tip in forum Java TipReplies: 0Last Post: 12-26-2007, 10:17 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks