fr.paris.lutece.util.mail
Class ByteArrayDataSource

java.lang.Object
  extended by fr.paris.lutece.util.mail.ByteArrayDataSource
All Implemented Interfaces:
Serializable, DataSource

public class ByteArrayDataSource
extends Object
implements DataSource, Serializable

This class is used by MailUtil.

See Also:
Serialized Form

Constructor Summary
ByteArrayDataSource(byte[] data, String type)
          Creates a new ByteArrayDataSource object.
ByteArrayDataSource(String data, String type)
          Creates a new ByteArrayDataSource object.
 
Method Summary
 String getContentType()
           
 InputStream getInputStream()
           
 String getName()
           
 OutputStream getOutputStream()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayDataSource

public ByteArrayDataSource(String data,
                           String type)
Creates a new ByteArrayDataSource object.

Parameters:
data - The data
type - The parameters

ByteArrayDataSource

public ByteArrayDataSource(byte[] data,
                           String type)
Creates a new ByteArrayDataSource object.

Parameters:
data - The data
type - The parameters
Method Detail

getInputStream

public InputStream getInputStream()
                           throws IOException
Specified by:
getInputStream in interface DataSource
Returns:
The input stream
Throws:
IOException - The IO exception

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Specified by:
getOutputStream in interface DataSource
Returns:
The output stream
Throws:
IOException - The IO exception

getContentType

public String getContentType()
Specified by:
getContentType in interface DataSource
Returns:
The content type

getName

public String getName()
Specified by:
getName in interface DataSource
Returns:
The Name


Copyright © 2014 Mairie de Paris. All Rights Reserved.