• Post Reply Bookmark Topic Watch Topic
  • New Topic

RandomAccessFile  RSS feed

 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can I use RandomAccessFile by connecting to url?
If yes, can someone give an example?
thanks,
Alex
 
Jim Bertorelli
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.
 
Vinny Chun
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is an exact question in the exam scam book from B.Brogden. Here is his explanation:
"....there is no way to create a RandonAccessFile from a URL. The basic reason is that there is no protocol for random access to files via HTTP."
 
Jim Bertorelli
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think this is a correct reason. A URL may not necessarily use HTTP.
The reason you cannot have random access to a URL is:
There is no concept of a "File Pointer" that you can move around in a URL. All you have is a stream of data. You do not have a "chunk" of data. Furthermore, you can have random access only if you have all the data buffered so that you can move the File Pointer around in that buffer.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!