Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to randomly access a text file  RSS feed

 
sachin raj
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q)how to access a file radomly.how to set file poinerto different positions?
 
jesse harris
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the RandomAccessFile class and the seek method. The class also has a length() method so you can seek to anywhere in the file.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!