Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hashmap not storing entire base64 string

Tags:

java

android

I have a base64 encoded string and inserting it in a hashmap but the value stored in the hashmap is just 10% of the base64 string. While debugging, I can confirm that the string has the entire value. Only when I 'put' the string in the hashmap it stores only 10% of it.

Hashmap<String, String> hashmap = new Hashmap<>();
String base64 = bitmapToString(mBitmap); // function is working properly and Im getting the entire string.
hashmap.put("image", base64); // Storing just 1005 characters for every image

Is there any limit to hashmap values? Its always storing strings not more than 1005 characters. FYI this code is used in an IntentService

like image 930
dhananjay dewan Avatar asked Feb 04 '26 17:02

dhananjay dewan


1 Answers

It was a limitation(?) of the Android Studio debugger where it only shows around 1000 characters when viewing all keys and values but if you expand an element in the hashmap then it displays the whole string. It was complacency from my part and I thank @assylias for his advice.

like image 145
dhananjay dewan Avatar answered Feb 07 '26 17:02

dhananjay dewan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!