Class InputStreamDataSource

  • All Implemented Interfaces:
    javax.activation.DataSource

    public final class InputStreamDataSource
    extends java.lang.Object
    implements javax.activation.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​(java.io.InputStream inputStream, java.lang.String contentType)
      Constructs a new instance.
      InputStreamDataSource​(java.io.InputStream inputStream, java.lang.String contentType, java.lang.String name)
      Constructs a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getContentType()  
      java.io.InputStream getInputStream()  
      java.lang.String getName()  
      java.io.OutputStream getOutputStream()
      Always throws UnsupportedOperationException.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InputStreamDataSource

        public InputStreamDataSource​(java.io.InputStream inputStream,
                                     java.lang.String contentType)
        Constructs a new instance.
        Parameters:
        inputStream - An input stream.
        contentType - A content type.
      • InputStreamDataSource

        public InputStreamDataSource​(java.io.InputStream inputStream,
                                     java.lang.String contentType,
                                     java.lang.String name)
        Constructs a new instance.
        Parameters:
        inputStream - An input stream.
        contentType - A content type.
        name - A name.
    • Method Detail

      • getContentType

        public java.lang.String getContentType()
        Specified by:
        getContentType in interface javax.activation.DataSource
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Specified by:
        getInputStream in interface javax.activation.DataSource
        Throws:
        java.io.IOException
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface javax.activation.DataSource
      • getOutputStream

        public java.io.OutputStream getOutputStream()
        Always throws UnsupportedOperationException.
        Specified by:
        getOutputStream in interface javax.activation.DataSource
        Returns:
        Always throws UnsupportedOperationException.
        Throws:
        java.lang.UnsupportedOperationException - Always throws UnsupportedOperationException.