Example usage for javax.jms StreamMessage writeBytes

List of usage examples for javax.jms StreamMessage writeBytes

Introduction

In this page you can find the example usage for javax.jms StreamMessage writeBytes.

Prototype


void writeBytes(byte[] value) throws JMSException;

Source Link

Document

Writes a byte array field to the stream message.

Usage

From source file:org.wso2.esb.integration.common.utils.clients.jmsclient.JMSQueueMessageProducer.java

/**
 * Method to send a StreamMessage.//from   w w  w  .  j  a v a2s .  c  om
 *
 * @param payload content of the StreamMessage to be sent
 * @throws JMSException if an error occurs sending the BytesMessage
 */
public void sendStreamMessage(byte[] payload) throws JMSException {
    checkIfConnected();
    StreamMessage streamMessage = session.createStreamMessage();
    streamMessage.writeBytes(payload);
    producer.send(streamMessage);
}