Class ByteArrayDataSource

java.lang.Object
org.apache.camel.attachment.ByteArrayDataSource
All Implemented Interfaces:
jakarta.activation.DataSource

public class ByteArrayDataSource extends Object implements jakarta.activation.DataSource
A DataSource that are in-memory using a byte array
  • Constructor Details

    • ByteArrayDataSource

      public ByteArrayDataSource(String fileName, byte[] data)
  • Method Details

    • getInputStream

      public InputStream getInputStream() throws IOException
      Specified by:
      getInputStream in interface jakarta.activation.DataSource
      Throws:
      IOException
    • getOutputStream

      public OutputStream getOutputStream() throws IOException
      Specified by:
      getOutputStream in interface jakarta.activation.DataSource
      Throws:
      IOException
    • getContentType

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

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