RandomAccess
RandomAccess file Example in java
RandomAccess Demo
import java.io.IOException; import java.io.RandomAccessFile; public class RandomAccesFileDemo { /** * * @author venugopal darur * */ public static void main(String[] args) { try { RandomAccessFile raf = new RandomAccessFile( "e:\\saimanwolverine.txt", "rw"); raf.seek(0); // go to the first integer raf.writeChars("This is random access file demo"); System.out.println("~~~~~~~~~~~~~~~~~~"); int i = raf.readInt(); while (i != -1) { System.out.println(i); i = raf.readInt(); } raf.close(); } catch (IOException e) { } } }
Please send comments to
vgdarur.javafive@blogger.com
Copyright © 2008 - iForeRunner.com
http://www.iforerunner.com/