dcsimg
end-of-file in Random access file
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   VV_VV
Posted On:   Thursday, August 9, 2001 09:19 AM

How do I know if the EOF is reached for a Random access file ?
Thanks

Re: end-of-file in Random access file

Posted By:   AlessandroA_Garbagnati  
Posted On:   Thursday, August 9, 2001 09:25 AM

Hi,


You know what, your answer is in the javadoc of the java.io.RandomAccessFile class:


It is generally true of all the reading routines in this class that if end-of-file is reached before the desired number of bytes has been read, an EOFException (which is a kind of IOException) is thrown. If any byte cannot be read for any reason other than end-of-file, an IOException other than EOFException is thrown. In particular, an IOException may be thrown if the stream has been closed.

;-)
About | Sitemap | Contact