我在使用 Bouncy caSTLe 的 Aes 中解密功能时遇到问题。
我有一个常规的加密/解密函数,但是太慢了。现在我尝试使用 BouncyCaSTLe 库中测试文件示例的部分代码来解决此问题。我写了这样的代码:
现在我收到一个错误
"E/dalvikvm-heap(548): Out of memory on a 52023154-byte allocation."
Caused by: java.lang.OutOfMemoryError when try to allocate byte[] plainText.
我对大小为 1-2 MB 的文件没有问题,但在大于 2MB 的文件上会出现此错误。
我对此没有任何想法,也没有在网络上找到任何回复。你能帮我吗?
最佳答案
我在这篇文章中找到了解决方案: How to change the android emulator RAM size from the command line? 通过这次升级我的堆大小!感谢社区!
关于Android/Java 使用 cipher.getOutputSize() 分配字节时内存不足 "OutOfMemoryError",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13614062/