P
Philipp
Hello
I need to write data to a RandomAccessFile. The data arrive in a
random way throughout time.
I'm searching for the optimal way of ensuring that the file is closed
in case the app shuts down and that the data has been flushed no too
long ago if the app crashes.
For now, I'm opening the file at each pack of data which arrives
(typically only one byte), write it to the file and close the file.
Is this very inefficient?
Should I keep the file open for long times (and maybe close it in a
(dreaded) finalizer)? If it all possible, I would like to not put the
burden on the user of my class to call some shutdown() method.
Is there a way to test whether a file has been closed before?
Thanks for answers (although I posting through GG
Phil
I need to write data to a RandomAccessFile. The data arrive in a
random way throughout time.
I'm searching for the optimal way of ensuring that the file is closed
in case the app shuts down and that the data has been flushed no too
long ago if the app crashes.
For now, I'm opening the file at each pack of data which arrives
(typically only one byte), write it to the file and close the file.
Is this very inefficient?
Should I keep the file open for long times (and maybe close it in a
(dreaded) finalizer)? If it all possible, I would like to not put the
burden on the user of my class to call some shutdown() method.
Is there a way to test whether a file has been closed before?
Thanks for answers (although I posting through GG
Phil