oracle.ord.im
Class OrdByteArraySource
java.lang.Object
|
+--oracle.ord.im.OrdByteArraySource
- All Implemented Interfaces:
- OrdContentSource
- public class OrdByteArraySource
- extends java.lang.Object
- implements OrdContentSource
An implementation class of OrdContentSource
to support using a byte array as the content source for deferred
loading.
Constructor Summary |
OrdByteArraySource(byte[] bytes)
Constructs an OrdByteArraySource instance. |
Type | Method |
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 |
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. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OrdByteArraySource
public OrdByteArraySource(byte[] bytes)
- Constructs an
OrdByteArraySource
instance.
- Parameters:
bytes
- a byte array containing the content to be loaded
setByteArray
public void setByteArray(byte[] bytes)
- Sets a byte array containing the content to be loaded.
- Parameters:
bytes
- a byte array containing the content to be loaded
getByteArray
public byte[] getByteArray()
- Gets a byte array containing the content to be loaded.
- Returns:
- a byte array containing the content to be loaded
getInputStream
public java.io.InputStream getInputStream()
throws java.io.IOException
- Gets an
InputStream
object from the byte array.
- Specified by:
getInputStream
in interface OrdContentSource
- Returns:
- a
ByteArrayInputStream
object
getContentLength
public int getContentLength()
throws java.io.IOException
- Gets the length of the content. The length is the size of the
byte array.
- Specified by:
getContentLength
in interface OrdContentSource
- Returns:
- the length of the content.
setMimeType
public void setMimeType(java.lang.String mimeType)
- Sets the
MIME
type information for the content.
- Parameters:
mimeType
- the MIME
type information
getMimeType
public java.lang.String getMimeType()
- Gets the
MIME
type information for the content.
Returns null
if this information was not set by
a previous setMimeType(String)
call.
- Specified by:
getMimeType
in interface OrdContentSource
- Returns:
- the
MIME
type information