OutputStream使用示例

File f = new File("d:"+File.separator+"1.bat");
FileOutputStream out = new FileOutputStream(f,false);
String str = "hello world";
byte b[] = str.getBytes();
out.write(b);
out.close();

你可能感兴趣的:(OutputStream使用示例)