admin
2021-08-27 d3a2058934c91d91ebb3a549701f267c66a83e52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package com.hanju.video.app.ui.video.parser;
 
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
 
public class Utils {
    static byte[] consumeInputStream(InputStream inputStream) throws IOException {
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        byte[] buffer = new byte[1024];
        for (int count; (count = inputStream.read(buffer)) != -1; ) {
            byteArrayOutputStream.write(buffer, 0, count);
        }
        return byteArrayOutputStream.toByteArray();
    }
}