我有一个以bytearray形式保存在数据库中的文件。我想以转换为bytearray之前的相同格式将字节数组写入文件。例如,如果文件是docx我想写为docx。
试 { x =“/ sdcard”; x + =“/ temp.pdf”;
FileOutputStream stream = new FileOutputStream(x);
try
{
stream.write(array);
stream.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
catch (FileNotFoundException e1)
{
e1.printStackTrace();
x="";
}