0
I am trying to convert a file from audio.3gp for string Base64 and send to the server using Volley, but for all I know, I need to transform the audio.3gp in Bytearray and transform that array string bytes Base64.
I don’t get any kind of error or warning in the compiler, only the return is hard to understand...
Example of byte return
[] = ������ ftyp3gp4��������isom3gp4���� �moov������lmvhd���������> ��
My code to turn File into Bytearray
File file1 = new File(path);
FileInputStream fis = null;
try {
fis = new FileInputStream(file1);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try {
while (fis.available() > 0) {
bos.write(fis.read());
}
} catch (IOException e1) {
e1.printStackTrace();
}
byte[] bytes = bos.toByteArray();
String msgDecode = new String(bytes);
System.out.print("BYTES ==== " + msgDecode);
Already tried to change the output charset, but did not solve...