Я хочу сохранить bytearray в файл в узле js, для android Я использую пример ниже кода. Может ли кто-нибудь предложить мне подобный подход?Сохранить массив байтов в файл узла JS
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();
}