Package javax.jms

Examples of javax.jms.BytesMessage.readBytes()


                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


                byte[] respBytes = null;
                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

        try {

            //1. construct mime header
            int mimeLength = bmessage.readInt();
            byte[] mbuf = new byte [mimeLength];
            bmessage.readBytes(mbuf, mimeLength);

            ByteArrayInputStream mbin = new ByteArrayInputStream (mbuf);
            ObjectInputStream oi = new ObjectInputStream (mbin);
            Hashtable ht = (Hashtable) oi.readObject();
            MimeHeaders mimeHeaders = hashtableToMime (ht);
View Full Code Here

            MimeHeaders mimeHeaders = hashtableToMime (ht);

            //2. get soap body stream.
            int bodyLength = bmessage.readInt();
            byte[] buf = new byte [bodyLength];
            bmessage.readBytes(buf, bodyLength);

            ByteArrayInputStream bin = new ByteArrayInputStream (buf);

            if ( messageFactory == null ) {
                messageFactory = getMessageFactory ();
View Full Code Here

                            String.valueOf(0));
            }
        } else if (jmsmsg instanceof BytesMessage) {
            BytesMessage m = (BytesMessage)jmsmsg;
            byte[] data = new byte[(int)m.getBodyLength()];
            m.readBytes(data);
            message.setBody(data);
            headers.put(StompFrameMessage.CommonHeader.CONTENTLENGTH,
                        String.valueOf(data.length));

        } else {
View Full Code Here

            else {
                final int len = (int) llen;
                final byte[] data = new byte[len];
                final int readLen;
                try {
                    readLen = byteMessage.readBytes(data);
                }
                catch (JMSException e) {
                    log.warn("Unable to get message bytes", e);
                    return;
                }
View Full Code Here

         {
            return null;
         }

         byte[] body = new byte[(int) size];
         bytesMessage.readBytes(body);

         String contentType = message.getStringProperty(HttpHeaderProperty.CONTENT_TYPE);
         if (contentType == null)
         {
            throw new UnknownMediaType("Message did not have a Content-Type header cannot extract entity");
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

        if (message instanceof BytesMessage) {
            try {
                BytesMessage bs = (BytesMessage) message;
                bs.reset();
                n = bs.readBytes(body);
            } catch (JMSException ex) {
                return ex.toString();
            }
        } else if (message instanceof StreamMessage) {
            try {
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.