/// <summary>
        /// This instance method enqueues multiple messages to a queue using the supplied enqueue options.
        /// </summary>
        /// <param name="messages"></param>
        /// <param name="options"></param>
        public Task <byte[][]> EnqueueArrayAsync(OracleAQMessage[] messages, OracleAQEnqueueOptions options, CancellationToken cancellationToken = default)
        {
            if (messages == null)
            {
                throw new ArgumentNullException(nameof(messages));
            }
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            // validate messages
            foreach (var message in messages)
            {
                message.ThrowIfInvalid();
            }

            switch (MessageType)
            {
            case OracleAQMessageType.Raw:
                return(OracleAQQueueUtil.EnqueueRawArrayAsync(this, options, messages, cancellationToken));

            case OracleAQMessageType.UDT:
                return(OracleAQQueueUtil.EnqueueUdtArrayAsync(this, options, messages, cancellationToken));

            case OracleAQMessageType.Xml:
                return(OracleAQQueueUtil.EnqueueXmlArrayAsync(this, options, messages, cancellationToken));

            default:
                throw new InvalidOperationException();
            }
        }
        /// <summary>
        /// This instance method dequeues multiple messages from a queue using the supplied dequeue options.
        /// </summary>
        /// <param name="count"></param>
        /// <param name="options"></param>
        public Task <OracleAQMessage[]> DequeueArrayAsync(int count, OracleAQDequeueOptions options, CancellationToken cancellationToken = default)
        {
            switch (MessageType)
            {
            case OracleAQMessageType.Raw:
                return(OracleAQQueueUtil.DequeueRawArrayAsync(this, options, count, log, cancellationToken));

            case OracleAQMessageType.UDT:
                return(OracleAQQueueUtil.DequeueUdtArrayAsync(this, options, count, log, cancellationToken));

            case OracleAQMessageType.Xml:
                return(OracleAQQueueUtil.DequeueXmlArrayAsync(this, options, count, log, cancellationToken));

            default:
                throw new InvalidOperationException();
            }
        }
 /// <summary>
 /// This instance method dequeues multiple messages from a queue using the supplied dequeue options.
 /// </summary>
 /// <param name="count"></param>
 /// <param name="options"></param>
 public OracleAQMessage[] DequeueArray(int count, OracleAQDequeueOptions options, CancellationToken cancellationToken = default)
 {
     return(OracleAQQueueUtil.DequeueUdtArrayAsync(this, options, count, log, cancellationToken).Result);
 }