Class AbstractValuePlainWriter

java.lang.Object
io.aiven.kafka.connect.common.output.plainwriter.AbstractValuePlainWriter
All Implemented Interfaces:
OutputFieldPlainWriter
Direct Known Subclasses:
Base64ValuePlainWriter, ValuePlainWriter

public abstract class AbstractValuePlainWriter extends Object implements OutputFieldPlainWriter
  • Constructor Details

    • AbstractValuePlainWriter

      public AbstractValuePlainWriter()
  • Method Details

    • write

      public void write(org.apache.kafka.connect.sink.SinkRecord record, OutputStream outputStream) throws IOException
      Takes the SinkRecord's value as a byte array.

      If the value is null, it outputs nothing.

      If the value is not null, it assumes the value is a byte array.

      Specified by:
      write in interface OutputFieldPlainWriter
      Parameters:
      record - the record to get the value from
      outputStream - the stream to write to
      Throws:
      org.apache.kafka.connect.errors.DataException - when the value is not actually a byte array
      IOException
    • getOutputBytes

      protected abstract byte[] getOutputBytes(byte[] value)