我有一个 base64 编码的字符串并将其插入 HashMap 中,但存储在 HashMap 中的值仅为 base64 字符串的 10%。在调试时,我可以确认字符串具有完整的值。只有当我将字符串“放入” HashMap 中时,它才存储其中的 10%。
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
hashmap 的值有限制吗?它总是存储不超过 1005 个字符的字符串。 仅供引用,此代码用于 IntentService
最佳答案
这是 Android Studio 调试器的一个限制(?),它在查看所有键和值时仅显示大约 1000 个字符,但如果您在 HashMap 中展开一个元素,它会显示整个字符串。这是我的自满,我感谢@assylias 的建议。
关于java - Hashmap 不存储整个 base64 字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43536503/