首页 > 代码库 > java中InputStream转化为byte[]数组

java中InputStream转化为byte[]数组

//org.apache.commons.io.IOUtils.toByteArray已经有实现

String filePath = "D:\\aaa.txt";
in = new FileInputStream(new File(filePath));
fileBytes =IOUtils.toByteArray(in);


java中InputStream转化为byte[]数组