change short video to byte array android

Solutions on MaxInterview for change short video to byte array android by the best coders in the world

showing results for - "change short video to byte array android"
Amanda
17 Jun 2020
1ByteArrayOutputStream baos = new ByteArrayOutputStream();
2FileInputStream fis = new FileInputStream(new File(yourUri));
3
4byte[] buf = new byte[1024];
5int n;
6while (-1 != (n = fis.read(buf)))
7    baos.write(buf, 0, n);
8
9byte[] videoBytes = baos.toByteArray();