-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HiveError('Not all bytes have been used.')
in Hive.init()
#24
Comments
Hi, Thanks for using Hive. Wow you are trying to store a massive String 😆 Currently Hive only supports Strings with a max length of 2^16-1 bytes. (see Limitations) The reason why I limited the max String length is that most of the Strings will be much shorter than the limit. This way the length can be stored in two bytes which saves disk space and improves performance. I'll try to think of a way support storing longer Strings while still maintaining the benefits for smaller strings. What kind of map did you try to store? |
But binary do you store with more bytes right? Honestly forget to save 2 bytes per String, it doesn't make sense compared to other data on an SD card. I tries to store the map that I get back from jaguar_serializer, but its a nested map if I think about it don't know if Hive can deal with that. Cheers |
Currently not but I plan to change that. I need to run a few benchmarks before tho.
Sorry I don't quite understand. Could you please rephrase that?
Nested maps should be no problem. But they have to be below 2^16-1 bytes. |
Ah I guess that was the problem I meant just use 4 bytes per entry. It really doesn't matter on todays phones |
Yeah you are probably right. I'll change that with the next update. This means another breaking change of the binary format. |
The limitations have been removed with version 0.5.0. But it seems like lazy boxes have a problem with very long lists. I'm working on a fix. |
Hi,
I thought I give hive a try. It worked well when I only stored one short string; But after storing a longer JSON String I get this exeption in line 144 of your frame.dart.
The string in questions is 1665544 characters long.
Btw: I tried first to store the map without converting to json, but when readin back I only got one long string.
I hope you can fix this.
Cheers
Thomas
The text was updated successfully, but these errors were encountered: