The Artima Developer Community
Sponsored Link

Java Answers Forum
random access file

1 reply on 1 page. Most recent reply: Sep 12, 2006 8:29 AM by Viswanatha Basavalingappa

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
a a

Posts: 2
Nickname: linayee
Registered: Sep, 2006

random access file Posted: Sep 10, 2006 12:33 AM
Reply to this message Reply
Advertisement
who someone can help me to give me an example coding for random access file using java programming. And please help me to understand this topic thank you


Viswanatha Basavalingappa

Posts: 84
Nickname: viswagb
Registered: Nov, 2003

Re: random access file Posted: Sep 12, 2006 8:29 AM
Reply to this message Reply
Take a look at this web , it has enough need full info on the same.

http://java.sun.com/docs/books/tutorial/essential/io/rafs.html


Example :
try{

File f = new File("test.txt");
RandomAccessFile raf = new RandomAccessFile(f, "rw");
// Read a character
char ch = raf.readChar();
// Seek to end of file
raf.seek(f.length());
// Append to the end
raf.writeChars("aString");
raf.close();
catch(IOException ioe)
{

}



Viswa
-------

Flat View: This topic has 1 reply on 1 page
Topic: How to send data from one server to another Previous Topic   Next Topic Topic: Eclipse 3.1 with SVN Code Version System

Sponsored Links



Google
  Web Artima.com   

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