The given response base64 encode data, but when they are given a huge size file. For the example for an above 100 MB video, I am not able to get a response, when calling the API?before getting out of memory
?error. How can I?solve it?
Error : OutOfMemoryError: Failed to allocate a 523993096-byte allocation with 16773216 free bytes and 256MB until OOM [closed]
.
My code:
try {
val file =
File(this.filesDir, "Project name")
//Base64
val Base64Value = "HFGFGRGRGDCEF"
if (Base64Value != null) {
val byteArr =
Base64.decode(Base64Value, Base64.DEFAULT)
val f = File(file.absolutePath, filename)
f.createNewFile()
val fo = FileOutputStream(f)
fo.write(byteArr)
fo.close()
} else {
return false
}
} catch (e: Exception) {
e.printStackTrace()
return false
}
question from:
https://stackoverflow.com/questions/66045724/how-to-read-a-huge-size-base64-response-in-soap-api 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…