Oracle

com.compoze.util
Class ByteArrayDataSource

java.lang.Object
  extended by com.compoze.util.ByteArrayDataSource

public class ByteArrayDataSource
extends java.lang.Object

This class implements a typed data source from a byte array.


Constructor Summary
ByteArrayDataSource(byte[] data, java.lang.String sContentType)
          Constructor.
ByteArrayDataSource(java.io.InputStream is, java.lang.String sContentType)
          Constructor.
ByteArrayDataSource(java.lang.String sData, java.lang.String sContentType)
          Constructor.
 
Method Summary
 java.lang.String getContentType()
          Get the content type of the data.
 java.io.InputStream getInputStream()
          Get an input stream to the data.
 java.lang.String getName()
          Get a name for the data source.
 java.io.OutputStream getOutputStream()
          Get an output stream to the data (not supported).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayDataSource

public ByteArrayDataSource(java.io.InputStream is,
                           java.lang.String sContentType)
Constructor.

Parameters:
is - the input stream to create from
sContentType - the content-type of the data

ByteArrayDataSource

public ByteArrayDataSource(byte[] data,
                           java.lang.String sContentType)
Constructor.

Parameters:
data - the data
sContentType - the content-type of the data

ByteArrayDataSource

public ByteArrayDataSource(java.lang.String sData,
                           java.lang.String sContentType)
Constructor.

Parameters:
data - the data
sContentType - the content-type of the data
Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Get an input stream to the data.

Returns:
the input stream to the data
Throws:
java.io.IOException - if no data is available

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Get an output stream to the data (not supported).

Returns:
an output stream to the data
Throws:
java.io.IOException - always thrown since this is not supported

getContentType

public java.lang.String getContentType()
Get the content type of the data.

Returns:
the content type

getName

public java.lang.String getName()
Get a name for the data source.

Returns:
a name for the data source

Oracle

Copyright ©1999-2008 Oracle All rights reserved.