public interface ContentContainer
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getContent()
Returns the content.
|
byte[] |
getContentAsBinary()
Returns the binary content if the content format is
ContentFormat.BINARY
or null otherwise. |
java.lang.String |
getContentAsUTF8()
Returns the UTF8 content if the content format is
ContentFormat.UTF8
or null otherwise. |
ContentFormat |
getContentFormat()
Returns the format used to store the component's content.
|
java.lang.String |
getName()
Returns the name of this container.
|
java.lang.String |
getTypeID()
Returns the ID of the container type declaration.
|
boolean |
isEmpty()
Returns true iff this container is empty i.e. has no content associated with it.
|
void |
readContainer(java.io.InputStream inputStream,
ContentFormat contentFormat)
Reads the container from the specified input stream.
|
void |
writeContainer(java.io.OutputStream outputStream)
Writes the container to the specified output stream.
|
java.lang.String getName()
java.lang.String getTypeID()
ContentFormat getContentFormat()
null
.null
.java.lang.Object getContent()
ContentFormat.UTF8
or a byte array if the content format is ContentFormat.BINARY
.
An empty container will return null
.null
getContentFormat()
,
getContentAsUTF8()
,
getContentAsBinary()
,
isEmpty()
java.lang.String getContentAsUTF8()
ContentFormat.UTF8
or null
otherwise.null
getContentFormat()
,
getContent()
,
getContentAsBinary()
,
isEmpty()
byte[] getContentAsBinary()
ContentFormat.BINARY
or null
otherwise.null
getContentFormat()
,
getContent()
,
getContentAsUTF8()
,
isEmpty()
boolean isEmpty()
void writeContainer(java.io.OutputStream outputStream) throws java.io.IOException
outputStream
- the output streamjava.io.IOException
- if the implementing code throws an IOExceptionisEmpty()
void readContainer(java.io.InputStream inputStream, ContentFormat contentFormat) throws java.io.IOException
ContentFormat.BINARY
then
the byte array is stored as-is. If the content format is ContentFormat.UTF8
then
the byte array is encoded as a UTF-8 string.outputStream
- the output streamcontentFormat
- the content format to be used for storing the inputjava.io.IOException
- if the implementing code throws an IOExceptionisEmpty()
(C) Copyright IBM Corp. 1994, 2015. All Rights Reserved.