java将byte[]数组写为文件

public void writeFile(byte[] bytes,String writePath){

try {
                       //writePath 为最终文件路径名 如:D://test.txt
FileOutputStream fos = new FileOutputStream(writePath);

fos.write(bytes);

fos.close();

} catch (Exception e) {

e.printStackTrace();

}

}

你可能感兴趣的:(byte[])