Recently, I encountered a confusion which is encoding large video file to base64 in Android.Until I write down the question,haven't solved it yet.
What am I do this because the server requires the client to upload files in this way,
I sought help from ChatGPT
,But it still cannot solve various problems that arise during the coding process, including OOM(Out of memory Exception..).
What I should do? thanks.
How to resolve and avoid the OOM Exception.
Wrap your OutputStream with
Base64OutputStream
:https://developer.android.com/reference/android/util/Base64OutputStream