小编Anu*_*dey的帖子

将字节数组保存到文件节点JS

我想将bytearray保存到节点js中的文件中,对于android我正在使用下面的代码示例.任何人都可以建议我采用类似的方法吗?

File file = new File(root, System.currentTimeMillis() + ".jpg");
if (file.exists())
    file.delete();
FileOutputStream fos = null;
try {
    fos = new FileOutputStream(file);
    fos.write(bytesarray);
    fos.close();
    return file;
}
catch (FileNotFoundException e) {
    e.printStackTrace();
}
catch (IOException e) {
    e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)

file writefile node.js

1
推荐指数
2
解决办法
1万
查看次数

标签 统计

file ×1

node.js ×1

writefile ×1