Package javax.jms

Examples of javax.jms.BytesMessage.readBytes()


        session.createBytesMessage();
        sessionControl.setReturnValue(message, 1);
        message.writeBytes(content);
        messageControl.setVoidCallable(1);
        message.readBytes(new byte[SimpleMessageConverter102.BUFFER_SIZE]);
        messageControl.setMatcher(new ArgumentsMatcher() {
            public boolean matches(Object[] arg0, Object[] arg1) {
                byte[] one = (byte[]) arg0[0];
                byte[] two = (byte[]) arg1[0];
                return Arrays.equals(one, two);
View Full Code Here


            public String toString(Object[] arg0) {
                return "bla";
            }
        });
        messageControl.setReturnValue(SimpleMessageConverter102.BUFFER_SIZE, 1);
        message.readBytes(new byte[SimpleMessageConverter102.BUFFER_SIZE]);
        messageControl.setReturnValue(5000 - SimpleMessageConverter102.BUFFER_SIZE, 1);
        sessionControl.replay();
        messageControl.replay();

        SimpleMessageConverter102 converter = new SimpleMessageConverter102();
View Full Code Here

            String text = ((TextMessage)message).getText();
            return evaluate(text);               
        } else if ( message instanceof BytesMessage ) {
            BytesMessage bm = (BytesMessage) message;
            byte data[] = new byte[(int) bm.getBodyLength()];
            bm.readBytes(data);
            return evaluate(data);
        }           
        return false;
    }
View Full Code Here

            }
           
        } else if ( message instanceof BytesMessage ) {
            BytesMessage bm = (BytesMessage) message;
            byte data[] = new byte[(int) bm.getBodyLength()];
            bm.readBytes(data);
            try {
                XmlObject object = XmlObject.Factory.parse(new ByteArrayInputStream(data));
                XmlObject[] objects = object.selectPath(xpath);
                return object!=null && objects.length>0;                      
            } catch (Throwable e) {
View Full Code Here

            String text = ((TextMessage)m).getText();
            return evaluate(text);               
        } else if ( m instanceof BytesMessage ) {
            BytesMessage bm = (BytesMessage) m;
            byte data[] = new byte[(int) bm.getBodyLength()];
            bm.readBytes(data);
            return evaluate(data);
        }           
        return false;
    }
View Full Code Here

                        wrapper.addChild(textData);
                    } else if (message instanceof BytesMessage) {
                        BytesMessage bm = (BytesMessage) message;
                        byte[] msgBytes = new byte[(int) bm.getBodyLength()];
                        bm.reset();
                        bm.readBytes(msgBytes);
                        DataHandler dataHandler = new DataHandler(
                            new ByteArrayDataSource(msgBytes));
                        OMText textData = soapFactory.createOMText(dataHandler, true);
                        wrapper.addChild(textData);
                        msgContext.setDoingMTOM(true);
View Full Code Here

            if (message instanceof BytesMessage) {
                byte[] buffer = new byte[8 * 1024];
                ByteArrayOutputStream out = new ByteArrayOutputStream();

                BytesMessage byteMsg = (BytesMessage) message;
                for (int bytesRead = byteMsg.readBytes(buffer); bytesRead != -1;
                     bytesRead = byteMsg.readBytes(buffer)) {
                    out.write(buffer, 0, bytesRead);
                }
                return new ByteArrayInputStream(out.toByteArray());

View Full Code Here

                byte[] buffer = new byte[8 * 1024];
                ByteArrayOutputStream out = new ByteArrayOutputStream();

                BytesMessage byteMsg = (BytesMessage) message;
                for (int bytesRead = byteMsg.readBytes(buffer); bytesRead != -1;
                     bytesRead = byteMsg.readBytes(buffer)) {
                    out.write(buffer, 0, bytesRead);
                }
                return new ByteArrayInputStream(out.toByteArray());

            } else if (message instanceof TextMessage) {
View Full Code Here

                if (response != null) {
                    byte[]                buffer = new byte[8 * 1024];
                    ByteArrayOutputStream out = new ByteArrayOutputStream();

                    for (int bytesRead = response.readBytes(buffer); bytesRead != -1;
                         bytesRead = response.readBytes(buffer)) {
                        out.write(buffer, 0, bytesRead);
                    }

                    respBytes = out.toByteArray();
View Full Code Here

                if (response != null) {
                    byte[]                buffer = new byte[8 * 1024];
                    ByteArrayOutputStream out = new ByteArrayOutputStream();

                    for (int bytesRead = response.readBytes(buffer); bytesRead != -1;
                         bytesRead = response.readBytes(buffer)) {
                        out.write(buffer, 0, bytesRead);
                    }

                    respBytes = out.toByteArray();
                }
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.