Class ByteArrayDataSource

java.lang.Object
com.sun.istack.ByteArrayDataSource
All Implemented Interfaces:
jakarta.activation.DataSource

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

    • ByteArrayDataSource

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

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

    • getContentType

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

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

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

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