Package org.apache.activemq.command

Examples of org.apache.activemq.command.ActiveMQBytesMessage.writeBytes()


    }

    private void flushBuffer() throws IOException {
        try {
            ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
            msg.writeBytes(buffer, 0, count);
            send(msg, false);
        } catch (JMSException e) {
            throw IOExceptionSupport.create(e);
        }
        count = 0;
View Full Code Here


    private void flushBuffer() throws IOException {
        if (count != 0) {
            try {
                ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
                msg.writeBytes(buffer, 0, count);
                send(msg, false);
            } catch (JMSException e) {
                throw IOExceptionSupport.create(e);
            }
            count = 0;
View Full Code Here

                    throw new ProtocolException("Text could not bet set: " + e, false, e);
                }
                msg = text;
            } else if(intendedType.equalsIgnoreCase("bytes")) {
                ActiveMQBytesMessage byteMessage = new ActiveMQBytesMessage();
                byteMessage.writeBytes(command.getContent());
                msg = byteMessage;
            } else {
                throw new ProtocolException("Unsupported message type '"+intendedType+"'",false);
            }
        }else if (headers.containsKey(Stomp.Headers.CONTENT_LENGTH)) {
View Full Code Here

                throw new ProtocolException("Unsupported message type '"+intendedType+"'",false);
            }
        }else if (headers.containsKey(Stomp.Headers.CONTENT_LENGTH)) {
            headers.remove(Stomp.Headers.CONTENT_LENGTH);
            ActiveMQBytesMessage bm = new ActiveMQBytesMessage();
            bm.writeBytes(command.getContent());
            msg = bm;
        } else {
            ActiveMQTextMessage text = new ActiveMQTextMessage();
            try {
                //text.setText(new String(command.getContent(), "UTF-8"));
View Full Code Here

    private void flushBuffer() throws IOException {
        if (count != 0) {
            try {
                ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
                msg.writeBytes(buffer, 0, count);
                send(msg, false);
            } catch (JMSException e) {
                throw IOExceptionSupport.create(e);
            }
            count = 0;
View Full Code Here

    private void flushBuffer() throws IOException {
        if (count != 0) {
            try {
                ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
                msg.writeBytes(buffer, 0, count);
                send(msg, false);
            } catch (JMSException e) {
                throw IOExceptionSupport.create(e);
            }
            count = 0;
View Full Code Here

public class OpenTypeSupportTest {
    private static final Logger LOG = LoggerFactory.getLogger(OpenTypeSupportTest.class);
    @Test
    public void testBrowseByteMessageFails() throws Exception {
        ActiveMQBytesMessage bm = new ActiveMQBytesMessage();
        bm.writeBytes("123456".getBytes());
        Object result = OpenTypeSupport.convert(bm);
        LOG.info("result : " + result);
    }
}
View Full Code Here

        final Map headers = command.getHeaders();
        final ActiveMQMessage msg;
        if (headers.containsKey(Stomp.Headers.CONTENT_LENGTH)) {
            headers.remove(Stomp.Headers.CONTENT_LENGTH);
            ActiveMQBytesMessage bm = new ActiveMQBytesMessage();
            bm.writeBytes(command.getContent());
            msg = bm;
        } else {
            ActiveMQTextMessage text = new ActiveMQTextMessage();
            try {
                text.setText(new String(command.getContent(), "UTF-8"));
View Full Code Here

        try {
            byte[] data = new byte[50];
            for (int i = 0; i < data.length; i++) {
                data[i] = (byte) i;
            }
            msg.writeBytes(data);
            msg.reset();
            byte[] test = new byte[data.length];
            msg.readBytes(test);
            for (int i = 0; i < test.length; i++) {
                assertTrue(test[i] == i);
View Full Code Here

        ActiveMQBytesMessage message = new ActiveMQBytesMessage();
        try {
            message.writeBoolean(true);
            message.writeByte((byte) 1);
            message.writeByte((byte) 1);
            message.writeBytes(new byte[1]);
            message.writeBytes(new byte[3], 0, 2);
            message.writeChar('a');
            message.writeDouble(1.5);
            message.writeFloat((float) 1.5);
            message.writeInt(1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.