/** * Saves media data downloaded from an API in {@code byte[]} format into a * file on the file system. * * @param mediaData the media data {@code byte[]} to store on the file system * @param file the file on the file system to save the media data into * @throws FileNotFoundException if the file exists but is a directory, does * not exist but cannot be created, or cannot be opened for any reason * @throws IOException if the file cannot be written to */ public static void saveMediaDataToFile(byte[] mediaData, File file) throws FileNotFoundException, IOException { writeBytesToStream(mediaData, new FileOutputStream(file)); }
/** * Saves media data downloaded from an API in {@code byte[]} format into a * file on the file system. * * @param mediaData the media data {@code byte[]} to store on the file system * @param file the file on the file system to save the media data into * @throws FileNotFoundException if the file exists but is a directory, does * not exist but cannot be created, or cannot be opened for any reason * @throws IOException if the file cannot be written to */ public static void saveMediaDataToFile(byte[] mediaData, File file) throws FileNotFoundException, IOException { writeBytesToStream(mediaData, new FileOutputStream(file)); }