String strTxt="文件内容";
FileOutputStream fount=new FileOutputStream(“xyz”);
byte[]b = new byte[1024];
b = StrTxt.getBytes();
int len =b.length;
int i = 0;
while (i<len){
fount.write(b[i]);
i++;
}
fount.close();