Package io.axoniq.dataprotection.serialization.converters

## Class ByteArrayToInputStreamConverter

- java.lang.Object
- - io.axoniq.dataprotection.serialization.converters.ByteArrayToInputStreamConverter

- All Implemented Interfaces:
    `ContentTypeConverter<byte[],​InputStream>`

      public class ByteArrayToInputStreamConverter
      extends Object
      implements ContentTypeConverter<byte[],​InputStream>

  ContentTypeConverter that converts byte arrays into InputStream. More specifically, it returns an ByteArrayInputStream with the underlying byte[] is backing data.
  Since:
    2.0
  Author:
    Allard Buijze

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ByteArrayToInputStreamConverter()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `InputStream` | `convert​(byte[] original)` | Converts the given object into another.
    `Class<byte[]>` | `expectedSourceType()` | The expected type of input data.
    `Class<InputStream>` | `targetType()` | The returned type of IntermediateRepresentation

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

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

- - ### Constructor Detail

    - #### ByteArrayToInputStreamConverter

          public ByteArrayToInputStreamConverter()

  - ### Method Detail

    - #### expectedSourceType

          public Class<byte[]> expectedSourceType()

      Description copied from interface: `ContentTypeConverter`
      The expected type of input data.
      Specified by:
        `expectedSourceType` in interface `ContentTypeConverter<byte[],​InputStream>`
      Returns:
        the expected data format in IntermediateRepresentation

    - #### targetType

          public Class<InputStream> targetType()

      Description copied from interface: `ContentTypeConverter`
      The returned type of IntermediateRepresentation
      Specified by:
        `targetType` in interface `ContentTypeConverter<byte[],​InputStream>`
      Returns:
        the output data format in IntermediateRepresentation

    - #### convert

          public InputStream convert​(byte[] original)

      Description copied from interface: `ContentTypeConverter`
      Converts the given object into another. Typically, these values are contained by a `SerializedObject` instance.
      Specified by:
        `convert` in interface `ContentTypeConverter<byte[],​InputStream>`
      Parameters:
        `original` - the value to convert
      Returns:
        the converted value