com.google.api.ads.common.lib.utils
Class ImageUtils

java.lang.Object
  extended by com.google.api.ads.common.lib.utils.ImageUtils

public final class ImageUtils
extends Object

A utility class for retrieving image datum.

Author:
Adam Rogal

Constructor Summary
ImageUtils()
          Default constructor.
 
Method Summary
 byte[] getImageDataFromFile(String fileName)
          Gets the image data byte[] located in fileName.
 byte[] getImageDataFromUrl(String url)
          Gets the image data byte[] located at url or null if the image could not be loaded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageUtils

public ImageUtils()
Default constructor.

Method Detail

getImageDataFromFile

public byte[] getImageDataFromFile(String fileName)
                            throws IOException
Gets the image data byte[] located in fileName.

Parameters:
fileName - the image file to load
Returns:
the image data byte[] located in fileName
Throws:
IOException - if the image could not be read

getImageDataFromUrl

public byte[] getImageDataFromUrl(String url)
                           throws IOException
Gets the image data byte[] located at url or null if the image could not be loaded.

Parameters:
url - the image URL to load
Returns:
the image data byte[] located at url
Throws:
IOException - if the image could not be read from the URL


Copyright © 2012. All Rights Reserved.