/** * Gets the media data {@code byte[]} located at {@code url} or * {@code null} if the media could not be loaded. * * @param url the media URL to load * @return the media data {@code byte[]} located at {@code url} * @throws IOException if the media could not be read from the URL */ public static byte[] getMediaDataFromUrl(String url) throws IOException { return getMediaDataFromUrl(new URL(url)); }
/** * Gets the media data {@code byte[]} located at {@code url} or * {@code null} if the media could not be loaded. * * @param url the media URL to load * @return the media data {@code byte[]} located at {@code url} * @throws IOException if the media could not be read from the URL */ public static byte[] getMediaDataFromUrl(String url) throws IOException { return getMediaDataFromUrl(new URL(url)); }
@Test public void testGetMediaDataFromUrl_urlArg() throws IOException { assertArrayEquals(TEST_DATA, Media.getMediaDataFromUrl(inputFile.toURI().toURL())); }
@Test public void testGetMediaDataFromUrl_stringArg() throws IOException { assertArrayEquals(TEST_DATA, Media.getMediaDataFromUrl(inputFile.toURI().toString())); }