I want to save bytearray to a file in node js, for android I'm using the below code sample, can anyone suggest me the similar approach
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();
}
DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
All I did was convertnew Buffer(
toBuffer.from(
and the warning is gone. – Zeebrugge