org.mule.providers.email.transformers
Class ByteArrayDataSource

java.lang.Object
  extended byorg.mule.providers.email.transformers.ByteArrayDataSource

public class ByteArrayDataSource
extends Object

This class implements a typed DataSource from:
- an InputStream
- a byte array
- a String

Version:
$Id: ByteArrayDataSource.java 3798 2006-11-04 04:07:14Z aperepel $
Author:
Colin Chalmers, Jon S. Stevens, Brett McLaughlin

Constructor Summary
ByteArrayDataSource(byte[] data, String type)
          Create a datasource from a byte array.
ByteArrayDataSource(InputStream aIs, String type)
          Create a datasource from an input stream.
ByteArrayDataSource(String data, String type)
          Create a datasource from a String.
 
Method Summary
 String getContentType()
          Get the content type.
 InputStream getInputStream()
          Get the input stream.
 String getName()
          Get the name.
 OutputStream getOutputStream()
          Get the OutputStream to write to
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayDataSource

public ByteArrayDataSource(byte[] data,
                           String type)
                    throws IOException
Create a datasource from a byte array.

Parameters:
data - A byte[].
type - A String.
Throws:
IOException

ByteArrayDataSource

public ByteArrayDataSource(InputStream aIs,
                           String type)
                    throws IOException
Create a datasource from an input stream.

Parameters:
aIs - An InputStream.
type - A String.
Throws:
IOException

ByteArrayDataSource

public ByteArrayDataSource(String data,
                           String type)
                    throws IOException
Create a datasource from a String.

Parameters:
data - A String.
type - A String.
Throws:
IOException
Method Detail

getContentType

public String getContentType()
Get the content type.

Returns:
A String.

getInputStream

public InputStream getInputStream()
                           throws IOException
Get the input stream.

Returns:
An InputStream.
Throws:
IOException

getName

public String getName()
Get the name.

Returns:
A String.

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Get the OutputStream to write to

Returns:
An OutputStream
Throws:
IOException


Copyright © 2003-2006 MuleSource Inc.. All Rights Reserved.