将字符串写入文件

String     dataUrl = "aaaaaaasdasdasdsada";
File sf = new File("E:/team_project_store/BI/teamplate_plate/images/" + t1.getPath());
				
if(!sf.exists()) {
	sf.createNewFile();
}

FileOutputStream fos = new FileOutputStream(sf);
fos.write(dataUrl.getBytes());
fos.flush();
fos.close();    

猜你喜欢

转载自blog.csdn.net/Sun_of_Rainy/article/details/85790213