public class MimeMessageInputStreamSource extends MimeMessageSource implements Disposable
DeferredFileOutputStream
with its threshold set to 100kbConstructor and Description |
---|
MimeMessageInputStreamSource(String key) |
MimeMessageInputStreamSource(String key,
InputStream in)
Construct a new MimeMessageInputStreamSource from an
InputStream that contains the bytes of a MimeMessage. |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Dispose the object
|
InputStream |
getInputStream()
Get an input stream to retrieve the data stored in the temporary file
|
long |
getMessageSize()
Get the size of the temp file
|
String |
getSourceId()
Returns the unique identifier of this input stream source
|
OutputStream |
getWritableOutputStream() |
public MimeMessageInputStreamSource(String key, InputStream in) throws javax.mail.MessagingException
InputStream
that contains the bytes of a MimeMessage.key
- the prefix for the name of the temp filein
- the stream containing the MimeMessagejavax.mail.MessagingException
- if an error occurs while trying to store the streampublic MimeMessageInputStreamSource(String key) throws javax.mail.MessagingException
javax.mail.MessagingException
public String getSourceId()
getSourceId
in class MimeMessageSource
public InputStream getInputStream() throws IOException
getInputStream
in class MimeMessageSource
BufferedInputStream
containing the dataIOException
- if an error occurs while generating the InputStreampublic long getMessageSize() throws IOException
getMessageSize
in class MimeMessageSource
IOException
- if an error is encoutered while computing the size of the
messagepublic OutputStream getWritableOutputStream() throws FileNotFoundException
FileNotFoundException
public void dispose()
Disposable
dispose
in interface Disposable
Disposable.dispose()
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.