Results 1 to 2 of 2
- 11-16-2007, 09:16 PM #1
BufferedReader .mark(int readAheadLimit)
I've been working on a file management class and would like to establish a permanent mark at the beginning of the file. I've been running into problems with the readAheadLimit. It's easy to go over while traversing the file.
Does anyone know how to establish a permanent mark at the beginning of the file to return to? I've considered remarking the file during certain method calls but this seems to be wasteful.
Thanks in advance.
- 11-16-2007, 10:58 PM #2
Here's one of the constructors for my class:
The problem is with the mark method. The int passed to it is the number of bytes the BufferedReader can read before it loses the mark. Since I have methods that jump all over the file, the BufferedReader eventually exceeds this number and throws an an exception. Anybody have any experience with this?Java Code:public FileBrowser(File readIt){ try{ this.f = readIt; this.fr = new FileReader(f); this.br = new BufferedReader(fr); br.mark((int)f.length() * 10); }catch (Exception e){ System.out.println("Problem creating FileBrowser " + e.toString()); } }
Similar Threads
-
How to use BufferedReader?
By ProgramBeginner in forum New To JavaReplies: 4Last Post: 10-11-2011, 02:56 PM -
Mark thread RESOLVED.
By Eranga in forum Suggestions & FeedbackReplies: 45Last Post: 04-02-2008, 10:34 AM -
how u rotate the arrow mark as the line moves accordingly
By sandhyau in forum AWT / SwingReplies: 1Last Post: 02-16-2008, 11:22 PM -
how to draw an arrow mark using java swing
By sandhyau in forum AWT / SwingReplies: 5Last Post: 02-07-2008, 11:52 AM -
Help with BufferedReader in java
By carl in forum New To JavaReplies: 2Last Post: 07-31-2007, 07:20 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks