ch.ige.edossier.util
Class ByteArrayDataSource

java.lang.Object
  extended bych.ige.edossier.util.ByteArrayDataSource
All Implemented Interfaces:
javax.activation.DataSource

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

Mit dieser Klasse kann bei einem Mail das Attachment als ByteArray übergeben werden. Diese Klasse ist eine Hilfsklasse für die Methode send(byte[] attachment).


Constructor Summary
ByteArrayDataSource(byte[] byteArray, java.lang.String mimeType)
          Konstruktor.
 
Method Summary
 java.lang.String getContentType()
          Gibt den ContentType zurück.
 java.io.InputStream getInputStream()
          Gibt den InputStream zurück.
 java.lang.String getName()
          Gibt den Namen zurück.
 java.io.OutputStream getOutputStream()
          Gibt den OutputStream zurück.
 
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 mimeType)
Konstruktor.

Parameters:
byteArray - übergebener ByteArray
mimeType - übergebener mimeType
Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Gibt den InputStream zurück.

Specified by:
getInputStream in interface javax.activation.DataSource
Returns:
ByteArrayInputStream des ByteArray
Throws:
java.io.IOException - Unerwarteter IO-Fehler

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Gibt den OutputStream zurück.

Specified by:
getOutputStream in interface javax.activation.DataSource
Returns:
null
Throws:
java.io.IOException - Unerwarteter IO-Fehler

getContentType

public java.lang.String getContentType()
Gibt den ContentType zurück.

Specified by:
getContentType in interface javax.activation.DataSource
Returns:
String des mimeType

getName

public java.lang.String getName()
Gibt den Namen zurück.

Specified by:
getName in interface javax.activation.DataSource
Returns:
null