Dear Friends, Is there any way to open an existing text file in update mode(not append mode)? I want to read the contents of the file and make changes to it. Thank u, Priya
posted 14 years ago
You want RandomAccessFile. You can read and/or write anywhere in the file (or append to the end) with that. You can't use streams or readers/writers directly on a RandomAccessFile. However, you can read some or all of the file into a byte array, do stream operations on a ByteArrayInputStream/ByteArrayOutputStream, then write some or all of the bytes back to the RandomAccessFile.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.