be.ehealth.technicalconnector.utils

## Class ByteArrayDatasource

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

- All Implemented Interfaces:
    DataSource
  Direct Known Subclasses:
    ByteArrayDatasource

      public class ByteArrayDatasource
      extends Object
      implements DataSource

  Datasource for the DataHandler. Implementation of `DataSource`

- - ### Constructor Summary

    Constructors
    Constructor and 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

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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 Detail

    - #### 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 Detail

    - #### getInputStream

          public InputStream getInputStream()
                                     throws IOException

      Specified by:
        `getInputStream` in interface `DataSource`
      Throws:
        `IOException`
      See Also:
        `DataSource.getInputStream()`

    - #### getOutputStream

          public OutputStream getOutputStream()
                                       throws IOException

      Specified by:
        `getOutputStream` in interface `DataSource`
      Throws:
        `IOException`
      See Also:
        `DataSource.getOutputStream()`

    - #### getContentType

          public String getContentType()

      Specified by:
        `getContentType` in interface `DataSource`
      See Also:
        `DataSource.getContentType()`

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `DataSource`
      See Also:
        `DataSource.getName()`

    - #### getByteArray

          public byte[] getByteArray()

      Returns:
        the byteArray

Connector Packaging generic 4.9.5 API
Copyright © {inceptionYear}-2026 eHealth. All Rights Reserved.