Package be.ehealth.technicalconnector.utils

# Class ByteArrayDatasource

java.lang.Object
be.ehealth.technicalconnector.utils.ByteArrayDatasource

All Implemented Interfaces:
  `jakarta.activation.DataSource`

public class ByteArrayDatasource extends Object implements jakarta.activation.DataSource
Datasource for the DataHandler. Implementation of `DataSource`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ByteArrayDatasource(byte[] byteArray)`
  Creates a new ByteArrayDataSource from a byte array
  `ByteArrayDatasource(byte[] byteArray, String contentType)`
  Creates a new ByteArrayDataSource from a byte array

- ## Method Summary

  Modifier and Type
  Method
  Description
  `byte[]`
  `getByteArray()`
  `String`
  `getContentType()`
  `InputStream`
  `getInputStream()`
  `String`
  `getName()`
  `OutputStream`
  `getOutputStream()`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ByteArrayDatasource

    public ByteArrayDatasource(byte[] byteArray)
    Creates a new ByteArrayDataSource from a byte array
    Parameters:
      `byteArray` -

  - ### ByteArrayDatasource

    public ByteArrayDatasource(byte[] byteArray, String contentType)
    Creates a new ByteArrayDataSource from a byte array
    Parameters:
      `byteArray` -

- ## Method Details

  - ### getInputStream

    public InputStream getInputStream() throws IOException
    Specified by:
      `getInputStream` in interface `jakarta.activation.DataSource`
    Throws:
      `IOException`
    See Also:
      - `DataSource.getInputStream()`

  - ### getOutputStream

    public OutputStream getOutputStream() throws IOException
    Specified by:
      `getOutputStream` in interface `jakarta.activation.DataSource`
    Throws:
      `IOException`
    See Also:
      - `DataSource.getOutputStream()`

  - ### getContentType

    public String getContentType()
    Specified by:
      `getContentType` in interface `jakarta.activation.DataSource`
    See Also:
      - `DataSource.getContentType()`

  - ### getName

    public String getName()
    Specified by:
      `getName` in interface `jakarta.activation.DataSource`
    See Also:
      - `DataSource.getName()`

  - ### getByteArray

    public byte[] getByteArray()
    Returns:
      the byteArray