Results 1 to 2 of 2
  1. #1
    bugger is offline Senior Member
    Join Date
    Nov 2007
    Posts
    111
    Rep Power
    0

    Default Randomly accessing a text file

    RandomAccessFile provides useful methods to read a file randomly.

    Java Code:
    RandomAccessFile ref = new RandomAccessFile("abc.txt", "r");
    I want to write some text at a random position in a file. Which class can provide the required functionality.

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    9

    Default

    The RandomAccessFile api has methods you can use to access and write to offsets within the file. For example, see getFilePointer, seek and writeUTF.

Similar Threads

  1. Randomly accessing files
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-12-2007, 10:46 AM
  2. Accessing a file randomly
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-10-2007, 08:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •