Class ByteArrayDataSource

  • All Implemented Interfaces:
    javax.activation.DataSource

    public class ByteArrayDataSource
    extends java.lang.Object
    implements javax.activation.DataSource
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.ByteArrayOutputStream data  
      private java.lang.String name  
      private java.lang.String type  
    • Constructor Summary

      Constructors 
      Constructor Description
      ByteArrayDataSource​(java.io.InputStream is)  
    • Field Detail

      • data

        private java.io.ByteArrayOutputStream data
      • type

        private java.lang.String type
      • name

        private java.lang.String name
    • Constructor Detail

      • ByteArrayDataSource

        public ByteArrayDataSource​(java.io.InputStream is)
                            throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getContentType

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

        public void setType​(java.lang.String type)
        Parameters:
        type - the type to set
      • setName

        public void setName​(java.lang.String name)
        Parameters:
        name - the name to set
      • 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()
                                             throws java.io.IOException
        Specified by:
        getOutputStream in interface javax.activation.DataSource
        Throws:
        java.io.IOException