Class InputStreamDataSource

  • All Implemented Interfaces:
    javax.activation.DataSource

    public class InputStreamDataSource
    extends Object
    implements javax.activation.DataSource
    A DataSource object encapsulating an InputStream.
    • Method Detail

      • newDataSource

        public static javax.activation.DataSource newDataSource​(InputStream inputStream,
                                                                String name,
                                                                String contentType)
        Creates a new DataSource wrapping the specified input stream, using the specified name and contentType.
        Parameters:
        inputStream - InputStream to be mapped
        name - name to be returned from DataSource
        contentType - contentType to be returned from DataSource
        Returns:
        the newly created DataSource
      • getInputStream

        public InputStream getInputStream()
        Specified by:
        getInputStream in interface javax.activation.DataSource
      • getOutputStream

        public OutputStream getOutputStream()
        Specified by:
        getOutputStream in interface javax.activation.DataSource
      • getContentType

        public String getContentType()
        Specified by:
        getContentType in interface javax.activation.DataSource
      • getName

        public String getName()
        Specified by:
        getName in interface javax.activation.DataSource