Package com.helger.mail.datasource
Class InputStreamDataSource
- java.lang.Object
-
- com.helger.mail.datasource.InputStreamDataSource
-
- All Implemented Interfaces:
com.helger.commons.io.IHasInputStream,IExtendedDataSource,jakarta.activation.DataSource
@NotThreadSafe public class InputStreamDataSource extends Object implements IExtendedDataSource, com.helger.commons.io.IHasInputStream
A specialDataSourceimplementation based on data fromInputStream.- Author:
- Philip Helger
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_READ_MULTIPLE-
Fields inherited from interface com.helger.mail.datasource.IExtendedDataSource
DEFAULT_CONTENT_TYPE
-
-
Constructor Summary
Constructors Constructor Description InputStreamDataSource(InputStream aIS, String sName)InputStreamDataSource(InputStream aIS, String sName, boolean bReadMultiple)InputStreamDataSource(InputStream aIS, String sName, com.helger.commons.mime.IMimeType aContentType)InputStreamDataSource(InputStream aIS, String sName, com.helger.commons.mime.IMimeType aContentType, boolean bReadMultiple)InputStreamDataSource(InputStream aIS, String sName, String sContentType)InputStreamDataSource(InputStream aIS, String sName, String sContentType, boolean bReadMultiple)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetContentType()InputStreamgetInputStream()intgetISAcquisitionCount()StringgetName()OutputStreamgetOutputStream()booleanisReadMultiple()StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.mail.datasource.IExtendedDataSource
getAsDataHandler, getEncodingAware
-
-
-
-
Field Detail
-
DEFAULT_READ_MULTIPLE
public static final boolean DEFAULT_READ_MULTIPLE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InputStreamDataSource
public InputStreamDataSource(@Nonnull InputStream aIS, @Nonnull String sName)
-
InputStreamDataSource
public InputStreamDataSource(@Nonnull InputStream aIS, @Nonnull String sName, boolean bReadMultiple)
-
InputStreamDataSource
public InputStreamDataSource(@Nonnull InputStream aIS, @Nonnull String sName, @Nullable com.helger.commons.mime.IMimeType aContentType, boolean bReadMultiple)
-
InputStreamDataSource
public InputStreamDataSource(@Nonnull InputStream aIS, @Nonnull String sName, @Nullable com.helger.commons.mime.IMimeType aContentType)
-
InputStreamDataSource
public InputStreamDataSource(@Nonnull InputStream aIS, @Nonnull String sName, @Nullable String sContentType)
-
-
Method Detail
-
isReadMultiple
public final boolean isReadMultiple()
- Specified by:
isReadMultiplein interfacecom.helger.commons.io.IHasInputStream
-
getISAcquisitionCount
@Nonnegative public final int getISAcquisitionCount()
- Returns:
- How often the input stream was already acquired. Always ≥ 0.
-
getInputStream
@Nonnull public InputStream getInputStream()
- Specified by:
getInputStreamin interfacejakarta.activation.DataSource- Specified by:
getInputStreamin interfacecom.helger.commons.io.IHasInputStream
-
getOutputStream
@UnsupportedOperation public OutputStream getOutputStream()
- Specified by:
getOutputStreamin interfacejakarta.activation.DataSource
-
getContentType
@Nonnull public String getContentType()
- Specified by:
getContentTypein interfacejakarta.activation.DataSource
-
getName
@Nonnull public String getName()
- Specified by:
getNamein interfacejakarta.activation.DataSource
-
-