Package ch.astorm.jotlmsg
Class OutlookMessageAttachment.MemoryInputStreamCreator
- java.lang.Object
-
- ch.astorm.jotlmsg.OutlookMessageAttachment.MemoryInputStreamCreator
-
- All Implemented Interfaces:
OutlookMessageAttachment.InputStreamCreator
- Enclosing class:
- OutlookMessageAttachment
public static class OutlookMessageAttachment.MemoryInputStreamCreator extends java.lang.Object implements OutlookMessageAttachment.InputStreamCreator
Wraps the creation of anInputStreamfrom a given sourceInputStream. The content of the sourceInputStreamwill be stored in-memory.
-
-
Constructor Summary
Constructors Constructor Description MemoryInputStreamCreator(java.io.InputStream source)Creates a newMemoryInputStreamCreatorwith the specifiedsource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStreamnewInputStream(OutlookMessageAttachment omt)Reads a newInputStreamwith the content of the source.
-
-
-
Method Detail
-
newInputStream
public java.io.InputStream newInputStream(OutlookMessageAttachment omt) throws java.io.IOException
Reads a newInputStreamwith the content of the source. The first time this method is called, the sourceInputStreamwill be fully read, closed and stored in-memory. Then, a newByteArrayInputStreamis returned.- Specified by:
newInputStreamin interfaceOutlookMessageAttachment.InputStreamCreator- Parameters:
omt- The attachment.- Returns:
- A new
ByteArrayInputStream. - Throws:
java.io.IOException- If an I/O error occurs.
-
-