My Xamarin app has some cached objects with Akavache. For testing purposes, I'm trying to get the cached data in raw JSON string format. I've tried the following, but I'm getting a weird string:
protected readonly IBlobCache cache;
private void ViewCachedData(string key) => this.cache.Get(key).Subscribe(OnDataLoaded);
private void OnDataLoaded(byte[] data) => Debug.WriteLine(Encoding.ASCII.GetString(data));
The Debug.WriteLine will only print a question mark, but checking the value I can see the JSON partially:
"?\0\0Value\0?\0\0EmployeeNumber\0\b\0\0\0848\0FirstName\0\0\0\0aaron\0LastName\0\0\0\0jones\0\nPreferredFirstName\0CellPhoneNumber\0\v\0\0\05555555555\0\n\0\0\0"
Akavache doesn't store things in JSON, it stores them in BSON