I am using Square Tape Queue (https://github.com/square/tape/) in order to store data. But i find this weird text sometimes and this leads to "JSONSyntaxException : Expected BEGIN_OBJECT but found String" while reading from Queue.
1 Answers
In https://github.com/square/tape/issues/5 , a Tape developer assures that Tape transactional mechanism is as safe as sqlite (which is the main storage engine for app data in Android, among other highly tested scenarios).
I suspect that clain isn't exactly truth. Tape is very simple internally and it trusts entirely in Java's APIs, which by it's turn only provides guarantees on specific filesystem block writing behavior, which many filesystems don't guarantee. This note comes from tape's webpage:
NOTE: The current implementation is built for file systems that support atomic segment writes (like YAFFS). Most conventional file systems don't support this; if the power goes out while writing a segment, the segment will contain garbage and the file will be corrupt.
You can see here that on Windows, at least, this seems to be the case: https://github.com/square/tape/issues/202
On Android, there's reports of occasional corruption on samsung devices (perhaps because it uses ffs instead of ext4).
I'm tempted to say don't rely on tape if you care for your data - but on the other hand tape has quite some user base too, so it seems to me it depends on your application scenario.

- 1,068
- 13
- 22