public class OrdByteArraySource extends java.lang.Object implements OrdContentSource
OrdContentSource
to support using a byte array as the content source for deferred
loading.Constructor and Description |
---|
OrdByteArraySource(byte[] bytes)
Constructs an
OrdByteArraySource instance. |
Modifier and Type | Method and Description |
---|---|
byte[] |
getByteArray()
Gets a byte array containing the content to be loaded.
|
int |
getContentLength()
Gets the length of the content.
|
java.io.InputStream |
getInputStream()
Gets an
InputStream object from the byte array. |
java.lang.String |
getMimeType()
Gets the
MIME type information for the content. |
void |
release()
Releases the resources used by the content source.
|
void |
setByteArray(byte[] bytes)
Sets a byte array containing the content to be loaded.
|
void |
setMimeType(java.lang.String mimeType)
Sets the
MIME type information for the content. |
public OrdByteArraySource(byte[] bytes)
OrdByteArraySource
instance.bytes
- a byte array containing the content to be loadedpublic void setByteArray(byte[] bytes)
bytes
- a byte array containing the content to be loadedpublic byte[] getByteArray()
public java.io.InputStream getInputStream() throws java.io.IOException
InputStream
object from the byte array.getInputStream
in interface OrdContentSource
ByteArrayInputStream
objectjava.io.IOException
public int getContentLength() throws java.io.IOException
getContentLength
in interface OrdContentSource
java.io.IOException
public void setMimeType(java.lang.String mimeType)
MIME
type information for the content.mimeType
- the MIME
type informationpublic java.lang.String getMimeType()
MIME
type information for the content.
Returns null
if this information was not set by
a previous setMimeType(String)
call.getMimeType
in interface OrdContentSource
MIME
type informationpublic void release()
OrdContentSource
release
in interface OrdContentSource