java byte数组转换成文件的两种方式
byte数组转换成文件
传统方式
FileOutputStream fos = new FileOutputStream(fileDest); fos.write(bytesArray); fos.close();
NIO方式
Path path = Paths.get(fileDest); Files.write(path, bytesArray);
byte数组转换成文件
传统方式
FileOutputStream fos = new FileOutputStream(fileDest);
fos.write(bytesArray);
fos.close();
NIO方式
Path path = Paths.get(fileDest);
Files.write(path, bytesArray);