-
Notifications
You must be signed in to change notification settings - Fork 286
Wrap QueueFile around an existing File? #199
Comments
This should work out of the box. What exception do you get when you try to load the queue after reboot? |
When I use, in my onCreate() or BootUpReceiver,
I end up with EOFException unless I perform |
I'm facing the same issue where I end up with an EOF exception unless I delete the underlying file. Is there a resolution here? |
I'm seeing the same problem as well. My purpose for using this library is to persist data locally and read it back in after an unexpected shutdown, but I I just get EOFException when trying to access the existing file (even if it's zero bytes). |
I think core issue for me is that the example is unclear as to what I'd think QueueFile would check the length of available bytes in the stream before attempting to read in the header (and if length is 0 bytes, just create the header), but apparently not. My solution was to ignore the reference in the example and just use: If I have some time to dig deeper into the source I'll submit a PR. |
I have the same problem. Is there a workaround? |
From Javadocs,
I have some messages to be sent to a server from custom android devices in FIFO order. If the device is rebooted before all the messages in the queue are successfully sent, the remainder is persisted in the
File
I wrapped thequeueFile
with.But I cannot import this existing file into a new instance(after reboot) of the QueueFile unless I delete the file. #125 which loses the messages stacked before shutdown.
How can I persist the queue across reboots using this library?
Let me know if you have any questions. Thanks
The text was updated successfully, but these errors were encountered: