/** * Gets the media data {@code byte[]} located in {@code fileName}. * * @param fileName the media file to load * @return the media data {@code byte[]} located in {@code fileName} * @throws IOException if the media could not be read */ public static byte[] getMediaDataFromFile(String fileName) throws IOException { return getMediaDataFromFile(new File(fileName)); }
/** * Gets the media data {@code byte[]} located in {@code fileName}. * * @param fileName the media file to load * @return the media data {@code byte[]} located in {@code fileName} * @throws IOException if the media could not be read */ public static byte[] getMediaDataFromFile(String fileName) throws IOException { return getMediaDataFromFile(new File(fileName)); }
@Test public void testGetMediaDataFromFile_stringArg() throws IOException { assertArrayEquals(TEST_DATA, Media.getMediaDataFromFile(inputFile.getPath())); }
@Test public void testGetMediaDataFromFile_fileArg() throws IOException { assertArrayEquals(TEST_DATA, Media.getMediaDataFromFile(inputFile)); }