|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.api.ads.common.lib.utils.Media
public final class Media
A utility class for retrieving media data.
| Method Summary | |
|---|---|
static byte[] |
getMediaDataFromFile(File file)
Gets the media data byte[] located in file. |
static byte[] |
getMediaDataFromFile(String fileName)
Gets the media data byte[] located in fileName. |
static byte[] |
getMediaDataFromUrl(String url)
Gets the media data byte[] located at url or
null if the media could not be loaded. |
static byte[] |
getMediaDataFromUrl(URL url)
Gets the media data byte[] located at url or
null if the media could not be loaded. |
static void |
saveMediaDataToFile(byte[] mediaData,
File file)
Saves media data downloaded from an API in byte[] format into a
file on the file system. |
static void |
saveMediaDataToFile(byte[] mediaData,
String fileName)
Saves media data downloaded from an API in byte[] format into a
file on the file system. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static byte[] getMediaDataFromFile(String fileName)
throws IOException
byte[] located in fileName.
fileName - the media file to load
byte[] located in fileName
IOException - if the media could not be read
public static byte[] getMediaDataFromFile(File file)
throws IOException
byte[] located in file.
file - the media file to load
byte[] located in file
IOException - if the media could not be read
public static byte[] getMediaDataFromUrl(String url)
throws IOException
byte[] located at url or
null if the media could not be loaded.
url - the media URL to load
byte[] located at url
IOException - if the media could not be read from the URL
public static byte[] getMediaDataFromUrl(URL url)
throws IOException
byte[] located at url or
null if the media could not be loaded.
url - the media URL to load
byte[] located at url
IOException - if the media could not be read from the URL
public static void saveMediaDataToFile(byte[] mediaData,
String fileName)
throws FileNotFoundException,
IOException
byte[] format into a
file on the file system.
mediaData - the media data byte[] to store on the file systemfileName - the name of the file on the file system to save the media
data into
FileNotFoundException - if the file exists but is a directory, does
not exist but cannot be created, or cannot be opened for any reason
IOException - if the file cannot be written to
public static void saveMediaDataToFile(byte[] mediaData,
File file)
throws FileNotFoundException,
IOException
byte[] format into a
file on the file system.
mediaData - the media data byte[] to store on the file systemfile - the file on the file system to save the media data into
FileNotFoundException - if the file exists but is a directory, does
not exist but cannot be created, or cannot be opened for any reason
IOException - if the file cannot be written to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||