📜  字节数组到文件 java 代码示例

📅  最后修改于: 2022-03-11 14:52:15.058000             🧑  作者: Mango

代码示例1
try (FileOutputStream fos = new FileOutputStream("pathname")) {
   fos.write(myByteArray);
   //fos.close(); There is no more need for this line since you had created the instance of "fos" inside the try. And this will automatically close the OutputStream
}