net.sourceforge.jaulp.email
Class ByteArrayDataSource

java.lang.Object
  extended by net.sourceforge.jaulp.email.ByteArrayDataSource
All Implemented Interfaces:
javax.activation.DataSource

public class ByteArrayDataSource
extends java.lang.Object
implements javax.activation.DataSource

DataSource object for a byte array.


Constructor Summary
ByteArrayDataSource(byte[] byteArray, java.lang.String contenttype)
          Constructor with the bytearray and the contenttype.
 
Method Summary
 byte[] getByteArray()
          Gets the byte array.
 java.lang.String getContentType()
          
 java.io.InputStream getInputStream()
          
 java.lang.String getName()
          
 java.io.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(byte[] byteArray,
                           java.lang.String contenttype)
Constructor with the bytearray and the contenttype.

Parameters:
byteArray - the bytearray.
contenttype - the contenttype.
Method Detail

getByteArray

public byte[] getByteArray()
Gets the byte array.

Returns:
Returns the data.

getContentType

public java.lang.String getContentType()

Specified by:
getContentType in interface javax.activation.DataSource
Returns:
the content type
See Also:
DataSource.getContentType()

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException

Specified by:
getInputStream in interface javax.activation.DataSource
Returns:
the input stream
Throws:
java.io.IOException - Signals that an I/O exception has occurred.
See Also:
DataSource.getInputStream()

getName

public java.lang.String getName()

Specified by:
getName in interface javax.activation.DataSource
Returns:
the name
See Also:
DataSource.getName()

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException

Specified by:
getOutputStream in interface javax.activation.DataSource
Returns:
the output stream
Throws:
java.io.IOException - Signals that an I/O exception has occurred.
See Also:
DataSource.getOutputStream()


Copyright © 2010. All Rights Reserved.