• Post Reply Bookmark Topic Watch Topic
  • New Topic

moving to BOF  RSS feed

 
Roshini Sridharan
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can anybody tell me how to move to the BOF when my file pointer is at the EOF. Is closing the stream and reopening it is the only way. I tried working with seek(file.length()*-1) but negative seek exception is thrown. Anybody will help me out in this.
 
Matts Smith
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
With RandomAccessFile the seek position is ALWAYS relative to the beginning of file so seek(0) will put the pointer on the first byte.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!