org.apache.cocoon.mail.datasource
Class InputStreamDataSource

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.mail.datasource.AbstractDataSource
          extended by org.apache.cocoon.mail.datasource.InputStreamDataSource
All Implemented Interfaces:
DataSource, LogEnabled

public class InputStreamDataSource
extends AbstractDataSource

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

Version:
$Id: InputStreamDataSource.html 1304258 2012-03-23 10:09:27Z 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.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
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.
Throws:
IOException

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.
Throws:
IOException
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-2010 The Apache Software Foundation. All Rights Reserved.