Class ByteArrayDataSource

  • All Implemented Interfaces:
    javax.activation.DataSource

    public final class ByteArrayDataSource
    extends Object
    implements javax.activation.DataSource
    DataSource backed by a byte buffer.
    Author:
    Kohsuke Kawaguchi
    • Constructor Detail

      • ByteArrayDataSource

        public ByteArrayDataSource​(byte[] buf,
                                   String contentType)
        Parameters:
        buf - input buffer - the byte array isn't being copied; used directly
        contentType -
      • ByteArrayDataSource

        public ByteArrayDataSource​(byte[] buf,
                                   int length,
                                   String contentType)
        Parameters:
        buf - input buffer - the byte array isn't being copied; used directly
        length -
        contentType -
    • Method Detail

      • getContentType

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

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

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

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