Package org.osgi.service.upnp
Interface UPnPIcon
-
public interface UPnPIcon
A UPnP icon representation. Each UPnP device can contain zero or more icons.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getDepth()
Returns the color depth of the icon in bits.int
getHeight()
Returns the height of the icon in pixels.java.io.InputStream
getInputStream()
Returns anInputStream
object for the icon data.java.lang.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.
-
-
-
Method Detail
-
getMimeType
java.lang.String getMimeType()
Returns the MIME type of the icon. This method returns the format in which the icon graphics, read from theInputStream
object obtained by thegetInputStream()
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"
This method must continue to return the icon MIME type after the UPnP device has been removed from the network.
- Returns:
- The MIME type of the encoded icon.
-
getWidth
int getWidth()
Returns the width of the icon in pixels. If the actual width of the icon is unknown, -1 is returned.This method must continue to return the icon width after the UPnP device has been removed from the network.
- Returns:
- The width in pixels, or -1 if unknown.
-
getHeight
int getHeight()
Returns the height of the icon in pixels. If the actual height of the icon is unknown, -1 is returned.This method must continue to return the icon height after the UPnP device has been removed from the network.
- Returns:
- The height in pixels, or -1 if unknown.
-
getSize
int getSize()
Returns the size of the icon in bytes. This method returns the number of bytes of the icon available to read from theInputStream
object obtained by thegetInputStream()
method. If the actual size can not be determined, -1 is returned.- Returns:
- The icon size in bytes, or -1 if the size is unknown.
- Throws:
java.lang.IllegalStateException
- if the UPnP device has been removed from the network.
-
getDepth
int getDepth()
Returns the color depth of the icon in bits.This method must continue to return the icon depth after the UPnP device has been removed from the network.
- Returns:
- The color depth in bits. If the actual color depth of the icon is unknown, -1 is returned.
-
getInputStream
java.io.InputStream getInputStream() throws java.io.IOException
Returns anInputStream
object for the icon data. TheInputStream
object provides a way for a client to read the actual icon graphics data. The number of bytes available from thisInputStream
object can be determined via thegetSize()
method. The format of the data encoded can be determined by the MIME type available via thegetMimeType()
method.- Returns:
- An InputStream to read the icon graphics data from.
- Throws:
java.io.IOException
- If theInputStream
cannot be returned.java.lang.IllegalStateException
- if the UPnP device has been removed from the network.- See Also:
getMimeType()
-
-