|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface modeling an image based on the types and information of the vCard Mime directory profile standard specification.
For reference see RFC 2426:
3.1.4 PHOTO Type Definition
3.5.3 LOGO Type Definition
Note that an Image might be either inlined as encoded
binary data (MimeBase64 Encoding) or represented
by an URI reference.
Should refer to or contain data of an IANA registered
image format for maximum compatibility.
Method Summary | |
java.lang.String |
getContentType()
Returns the content type of this Image. |
byte[] |
getData()
Returns the non-encoded binary data representing this Image. |
byte[] |
getDataFromURI()
Returns the data obtained from the uri of this Image. |
java.io.InputStream |
getInputStream()
Returns an InputStream providing access to the data of this Image. |
java.lang.String |
getURI()
Returns the URI reference representing this Image. |
boolean |
isData()
Tests if this Image is given as binary data. |
boolean |
isURI()
Tests if this Image is given as an URI reference. |
void |
setContentType(java.lang.String ctype)
Sets the content type of this Image. |
void |
setData(byte[] data)
Sets the non-encoded binary data representing this Image. |
void |
setData(java.lang.String uri)
Sets the non-encoded binary data as obtained from the given uri. |
void |
setURI(java.lang.String uri)
Sets the URI reference representing this Image. |
Method Detail |
public boolean isURI()
public java.lang.String getURI()
public void setURI(java.lang.String uri)
uri
- the URI reference as String.public boolean isData()
public java.lang.String getContentType()
public void setContentType(java.lang.String ctype)
ctype
- the content type as String.public byte[] getData()
public void setData(byte[] data)
data
- the non-encoded binary data as byte[].public void setData(java.lang.String uri) throws java.io.IOException, java.net.MalformedURLException
uri
- an URI as String.
java.io.IOException
java.net.MalformedURLException
public java.io.InputStream getInputStream() throws java.io.IOException, java.net.MalformedURLException
An implementation might use a ByteArrayInputStream for inlined data, or return the input stream which can be obtained from the URI (i.e. using java.net.URL).
java.io.IOException
java.net.MalformedURLException
public byte[] getDataFromURI() throws java.io.IOException, java.net.MalformedURLException
java.io.IOException
java.net.MalformedURLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |