首页 > 代码库 > FileOutputStream和FileInputStream的用法

FileOutputStream和FileInputStream的用法

public static void show()
{
File f=new File("d:"+File.separator+"1.txt");
FileOutputStream fo=new FileOutputStream(f,ture);
String str="你好";
fo.erite(str.getBytes());
fo.close();
FileInputStream fi=new FileInputstream(f);
byte [] buffer=new byte[1024];
int len=fi.read(buffer);
System.out.println(new String(buffer,0,len));
fi.close();
 
}

FileOutputStream和FileInputStream的用法