Package org.apache.commons.mail.activation

# Class InputStreamDataSource

java.lang.Object
org.apache.commons.mail.activation.InputStreamDataSource

All Implemented Interfaces:
  `DataSource`

public final class InputStreamDataSource extends Object implements DataSource
A JavaBeans Activation Framework `DataSource` specialized for `InputStream`.

Copied from Apache CXF and modified.

Since:
  1.6.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `InputStreamDataSource(InputStream inputStream, String contentType)`
  Constructs a new instance.
  `InputStreamDataSource(InputStream inputStream, String contentType, String name)`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getContentType()`
  `InputStream`
  `getInputStream()`
  `String`
  `getName()`
  `OutputStream`
  `getOutputStream()`
  Always throws `UnsupportedOperationException`.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### InputStreamDataSource

    public InputStreamDataSource(InputStream inputStream, String contentType)
    Constructs a new instance.
    Parameters:
      `inputStream` - An input stream.
      `contentType` - A content type.

  - ### InputStreamDataSource

    public InputStreamDataSource(InputStream inputStream, String contentType, String name)
    Constructs a new instance.
    Parameters:
      `inputStream` - An input stream.
      `contentType` - A content type.
      `name` - A name.

- ## Method Details

  - ### getContentType

    public String getContentType()
    Specified by:
      `getContentType` in interface `DataSource`

  - ### getInputStream

    public InputStream getInputStream() throws IOException
    Specified by:
      `getInputStream` in interface `DataSource`
    Throws:
      `IOException`

  - ### getName

    public String getName()
    Specified by:
      `getName` in interface `DataSource`

  - ### getOutputStream

    public OutputStream getOutputStream()
    Always throws `UnsupportedOperationException`.
    Specified by:
      `getOutputStream` in interface `DataSource`
    Returns:
      Always throws `UnsupportedOperationException`.
    Throws:
      `UnsupportedOperationException` - Always throws `UnsupportedOperationException`.