org.apache.felix.upnp.basedriver.importer.core.upnp
Class UPnPIconImpl

java.lang.Object
  extended by org.apache.felix.upnp.basedriver.importer.core.upnp.UPnPIconImpl
All Implemented Interfaces:
UPnPIcon

public class UPnPIconImpl
extends Object
implements UPnPIcon


Constructor Summary
UPnPIconImpl(org.cybergarage.upnp.Icon cybericon, org.cybergarage.upnp.Device cyberdev)
           
 
Method Summary
 int getDepth()
          Returns the color depth of the icon in bits.
 int getHeight()
          Returns the height of the icon in pixels.
 InputStream getInputStream()
          Returns an InputStream object for the icon data.
 String getMimeType()
          Returns the MIME type of the icon.
 int getSize()
          Returns the size of the icon in bytes.
 int getWidth()
          Returns the width of the icon in pixels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UPnPIconImpl

public UPnPIconImpl(org.cybergarage.upnp.Icon cybericon,
                    org.cybergarage.upnp.Device cyberdev)
Method Detail

getMimeType

public String getMimeType()
Description copied from interface: UPnPIcon
Returns the MIME type of the icon. This method returns the format in which the icon graphics, read from the InputStream object obtained by the getInputStream() method, is encoded.

The format of the returned string is in accordance to RFC2046. A list of valid MIME types is maintained by the IANA.

Typical values returned include: "image/jpeg" or "image/gif"

Specified by:
getMimeType in interface UPnPIcon
Returns:
The MIME type of the encoded icon.

getWidth

public int getWidth()
Description copied from interface: UPnPIcon
Returns the width of the icon in pixels. If the actual width of the icon is unknown, -1 is returned.

Specified by:
getWidth in interface UPnPIcon
Returns:
The width in pixels, or -1 if unknown.

getHeight

public int getHeight()
Description copied from interface: UPnPIcon
Returns the height of the icon in pixels. If the actual height of the icon is unknown, -1 is returned.

Specified by:
getHeight in interface UPnPIcon
Returns:
The height in pixels, or -1 if unknown.

getSize

public int getSize()
Description copied from interface: UPnPIcon
Returns the size of the icon in bytes. This method returns the number of bytes of the icon available to read from the InputStream object obtained by the getInputStream() method. If the actual size can not be determined, -1 is returned.

Specified by:
getSize in interface UPnPIcon
Returns:
The icon size in bytes, or -1 if the size is unknown.

getDepth

public int getDepth()
Description copied from interface: UPnPIcon
Returns the color depth of the icon in bits.

Specified by:
getDepth in interface UPnPIcon
Returns:
The color depth in bits. If the actual color depth of the icon is unknown, -1 is returned.

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: UPnPIcon
Returns an InputStream object for the icon data. The InputStream object provides a way for a client to read the actual icon graphics data. The number of bytes available from this InputStream object can be determined via the getSize() method. The format of the data encoded can be determined by the MIME type availble via the getMimeType() method.

Specified by:
getInputStream in interface UPnPIcon
Returns:
An InputStream to read the icon graphics data from.
Throws:
IOException - If the InputStream cannot be returned.
See Also:
UPnPIcon.getMimeType()


Copyright © 2011 Apache Software Foundation. All Rights Reserved.