The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
August 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Reading from Files

Posted by Hiran Watson on August 02, 2001 at 4:05 PM

Hi, I am writing a program that involves reading and writing to files. I was wondering if I've started reading from a file, and I want to start reading from the beginning of that file, how I'd do it. I am using BufferedReader in addition to a FileReader. I know that BufferedReader has a method called mark, and a method called reset. Will this work? Also, the mark method takes an integer that limits the number of characters that may be read while still preserving the mark. What if I don't want a limit? How do I specify no limit? Is there any other way that I can start reading from the beginning of the file (such as close and open the FileReader stream)? Thanks in advance for the help.
Hiran



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us