Answers for "change short video to byte array android"

0

change short video to byte array android

ByteArrayOutputStream baos = new ByteArrayOutputStream();
FileInputStream fis = new FileInputStream(new File(yourUri));

byte[] buf = new byte[1024];
int n;
while (-1 != (n = fis.read(buf)))
    baos.write(buf, 0, n);

byte[] videoBytes = baos.toByteArray();
Posted by: Guest on November-23-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language