//strFilePath:文件名,strText:要是写入的内容
public static boolean writefile(String strFilePath,String strText)
{FileOutputStream fos = null;
BufferedOutputStream osw = null;
File file =new File(strFilePath);
try
{
fos = new FileOutputStream(file);
osw = new BufferedOutputStream(fos);
byte[] bom={-1, -2};
osw.write(bom);
osw.write(strText.getBytes("UTF-16LE"));
osw.flush();
fos.close();
osw.close();
}
catch(Exception e)
{
e.printStackTrace();
}
return true;
}