使用FileOutputStream将字节数组写入文件
/** * N o w J a v a . c o m 提 供 **/ import java.io.*; public class Main { public static void main(String[] args) { String strFilePath = "C://Folder//demo.txt"; try { FileOutputStream fos = new FileOutputStream(strFilePath); String strContent = "Write File using Java FileOutputStream example !"; fos.write(strContent.getBytes()); fos.close(); } catch(FileNotFoundException ex) /* N o w J a v a . c o m */ { System.out.println("FileNotFoundException : " + ex);