org.apache.cocoon.mail.datasource
Class InputStreamDataSource

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.mail.datasource.AbstractDataSource
          extended byorg.apache.cocoon.mail.datasource.InputStreamDataSource
All Implemented Interfaces:
DataSource

public class InputStreamDataSource
extends AbstractDataSource

The InputStreamDataSource class provides an object, that wraps an InputStream object in a DataSource interface.

Version:
$Id: InputStreamDataSource.html 1304280 2012-03-23 11:18:01Z ilgrosso $
See Also:
DataSource

Constructor Summary
InputStreamDataSource(byte[] data, String type, String name)
          Creates a new instance of FilePartDataSource from a byte array.
InputStreamDataSource(InputStream in)
          Creates a new instance of FilePartDataSource from an InputStream object.
InputStreamDataSource(InputStream in, String type, String name)
          Creates a new instance of FilePartDataSource from an InputStream object.
 
Method Summary
 InputStream getInputStream()
          The InputStream object passed into contructor.
 
Methods inherited from class org.apache.cocoon.mail.datasource.AbstractDataSource
getContentType, getName, getOutputStream, isNullOrEmpty, setContentType, setName
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputStreamDataSource

public InputStreamDataSource(InputStream in)
                      throws IOException
Creates a new instance of FilePartDataSource from an InputStream object.

Parameters:
in - An InputStream object.

InputStreamDataSource

public InputStreamDataSource(byte[] data,
                             String type,
                             String name)
Creates a new instance of FilePartDataSource from a byte array.


InputStreamDataSource

public InputStreamDataSource(InputStream in,
                             String type,
                             String name)
                      throws IOException
Creates a new instance of FilePartDataSource from an InputStream object.

Parameters:
in - An InputStream object.
Method Detail

getInputStream

public InputStream getInputStream()
The InputStream object passed into contructor.

Specified by:
getInputStream in interface DataSource
Specified by:
getInputStream in class AbstractDataSource
Returns:
The InputStream object for this DataSource object.


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.