日期:2014-05-20 浏览次数:21090 次
byte[] byteArray={0x59,0x34,0x45};
File f = new File("temp.te");
if(!f.exists())
{
try {
f.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
FileOutputStream fos;
try {
fos = new FileOutputStream(f);
fos.write(byteArray);
fos.close();
//do something you want;
f.delete();//delete it after using it
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
------解决方案--------------------