com.ibm.broker.connector

Class ByteArrayPollingResult



  • public class ByteArrayPollingResult
    extends PollingResult
    ByteArrayPollingResult provides a default class to handle byte array based polling results.

    This class provides default handling of byte array results. You need only override methods where the default behaviour needs changing.

    • Constructor Detail

      • ByteArrayPollingResult

        public ByteArrayPollingResult(PollingInputConnector connector,
                                      byte[] data)
                               throws com.ibm.broker.plugin.MbException
        Provides a default implementation.
        Parameters:
        connector - The owning connector.
        data - The data to be passed to the flow.
        Throws:
        com.ibm.broker.plugin.MbException
      • ByteArrayPollingResult

        public ByteArrayPollingResult(PollingInputConnector connector,
                                      byte[] data,
                                      long offset)
                               throws com.ibm.broker.plugin.MbException,
                                      java.lang.IndexOutOfBoundsException
        Provides a default implementation. A range from data between 0 and offset will be used.
        Parameters:
        connector - The owning connector.
        data - The data to be passed to the flow.
        offset - The offset into data.
        Throws:
        com.ibm.broker.plugin.MbException
        java.lang.IndexOutOfBoundsException - Thrown if offset is negative or greater than the Length of data.
    • Method Detail

      • buildInputRecord

        public InputRecord buildInputRecord()
                                     throws com.ibm.broker.plugin.MbException
        Provides a default implementation of buildInputRecord. If not overridden, a new ByteArrayInputRecord is returned, populated from the given data.
        Specified by:
        buildInputRecord in class PollingResult
        Returns:
        A new InputRecord.
        Throws:
        com.ibm.broker.plugin.MbException
      • getBytes

        public final byte[] getBytes()
        Returns the data associated with this result.
        Returns:
        The byte array passed in on the constructor.
      • getOffset

        public final long getOffset()
        Returns the offset passed in on the constructor, or if the two argument constructor was used, the Length of the byte array.
        Returns:
        The provided offset or the Length of the byte array.
IBM Integration BusTM
JavaTM Connector API