The Artima Developer Community
Sponsored Link

Java Answers Forum
Can text be inserted into a file using RandomAccessFile?

1 reply on 1 page. Most recent reply: Dec 6, 2002 3:14 AM by Venugopal Bandari

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
jinaraj

Posts: 8
Nickname: bullet
Registered: Feb, 2002

Can text be inserted into a file using RandomAccessFile? Posted: Dec 4, 2002 5:30 PM
Reply to this message Reply
Advertisement
Is it possible to insert text into a file without overwriting the contents using RandomAccessFile class?
Imagine the text to be inserted should go to any position in the file. Can anybody suggest a way to do this without creating a copy of the file?


Venugopal Bandari

Posts: 5
Nickname: bandari
Registered: Dec, 2002

Re: Can text be inserted into a file using RandomAccessFile? Posted: Dec 6, 2002 3:14 AM
Reply to this message Reply
hai,

it is not possible. if u really want to implement this type of logic. first Read the entire contents and store it in StringBuffer. then do the manipulation u want. and finally write the StringBuffer contents into file. ok...

u can contanct me in e-mail: vgbandari@hotmail.com

Flat View: This topic has 1 reply on 1 page
Topic: how can i dynamically change a JTree root Previous Topic   Next Topic Topic: Java applets and security

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use