Package org.hornetq.api.core

Examples of org.hornetq.api.core.HornetQBuffer.readBytes()


      currentLargeMessageController.setLocal(true);

      //sets the packet
      HornetQBuffer qbuff = clMessage.getBodyBuffer();
      int bytesToRead = qbuff.writerIndex() - qbuff.readerIndex();
      final byte[] body = qbuff.readBytes(bytesToRead).toByteBuffer().array();

      largeMessage.setLargeMessageController(new CompressedLargeMessageControllerImpl(currentLargeMessageController));
      SessionReceiveContinuationMessage packet = new SessionReceiveContinuationMessage(this.getID(), body, false, false, body.length);
      currentLargeMessageController.addPacket(packet);
View Full Code Here


         {
            //decompress
            HornetQBuffer qbuff = newServerMessage.getBodyBuffer();
            int bytesToRead = qbuff.writerIndex() - MessageImpl.BODY_OFFSET;
            Inflater inflater = new Inflater();
            inflater.setInput(qbuff.readBytes(bytesToRead).toByteBuffer().array());
           
           
            //get the real size of large message
            long sizeBody = newServerMessage.getLongProperty(Message.HDR_LARGE_BODY_SIZE);
View Full Code Here

      currentLargeMessageController.setLocal(true);

      //sets the packet
      HornetQBuffer qbuff = clMessage.getBodyBuffer();
      int bytesToRead = qbuff.writerIndex() - qbuff.readerIndex();
      final byte[] body = qbuff.readBytes(bytesToRead).toByteBuffer().array();

      largeMessage.setLargeMessageController(new CompressedLargeMessageControllerImpl(currentLargeMessageController));
      SessionReceiveContinuationMessage packet = new SessionReceiveContinuationMessage(this.getID(), body, false, false, body.length);
      currentLargeMessageController.addPacket(packet);
View Full Code Here

         buffer.readerIndex(MessageImpl.BUFFER_HEADER_SPACE + DataConstants.SIZE_INT);
         byte[] data = new byte[size];
         if (serverMessage.containsProperty(Stomp.Headers.CONTENT_LENGTH) || serverMessage.getType() == Message.BYTES_TYPE)
         {
            headers.put(Headers.CONTENT_LENGTH, data.length);
            buffer.readBytes(data);
         }
         else
         {
            SimpleString text = buffer.readNullableSimpleString();
            if (text != null)
View Full Code Here

      currentLargeMessageController.setLocal(true);

      //sets the packet
      HornetQBuffer qbuff = clMessage.getBodyBuffer();
      int bytesToRead = qbuff.writerIndex() - qbuff.readerIndex();
      final byte[] body = qbuff.readBytes(bytesToRead).toByteBuffer().array();

      largeMessage.setLargeMessageController(new CompressedLargeMessageControllerImpl(currentLargeMessageController));
      SessionReceiveContinuationMessage packet = new SessionReceiveContinuationMessage(this.getID(), body, false, false, body.length);
      currentLargeMessageController.addPacket(packet);
View Full Code Here

      currentLargeMessageController.setLocal(true);

      //sets the packet
      HornetQBuffer qbuff = clMessage.getBodyBuffer();
      int bytesToRead = qbuff.writerIndex() - qbuff.readerIndex();
      final byte[] body = qbuff.readBytes(bytesToRead).toByteBuffer().array();

      largeMessage.setLargeMessageController(new CompressedLargeMessageControllerImpl(currentLargeMessageController));
      SessionReceiveContinuationMessage packet = new SessionReceiveContinuationMessage(this.getID(), body, false, false, body.length);
      currentLargeMessageController.addPacket(packet);
View Full Code Here

     * @throws Exception if an error occurs while trying to read the body content.
     */
    public Object readObjectFromMessage(final ClientMessage msg) throws Exception {
        byte[] bytes = new byte[msg.getBodySize()];
        final HornetQBuffer bodyBuffer = msg.getBodyBuffer();
        bodyBuffer.readBytes(bytes);

        Object result = null;
        try {
            final ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
            result = in.readObject();
View Full Code Here

      if (serverMessage.containsProperty(Stomp.Headers.CONTENT_LENGTH)
            || serverMessage.getType() == Message.BYTES_TYPE)
      {
         frame.addHeader(Headers.CONTENT_LENGTH, String.valueOf(data.length));
         buffer.readBytes(data);
      }
      else
      {
         SimpleString text = buffer.readNullableSimpleString();
         if (text != null)
View Full Code Here

         buffer.readerIndex(MessageImpl.BUFFER_HEADER_SPACE + DataConstants.SIZE_INT);
         byte[] data = new byte[size];
         if (serverMessage.containsProperty(Stomp.Headers.CONTENT_LENGTH) || serverMessage.getType() == Message.BYTES_TYPE)
         {
            headers.put(Headers.CONTENT_LENGTH, data.length);
            buffer.readBytes(data);
         }
         else
         {
            SimpleString text = buffer.readNullableSimpleString();
            if (text != null)
View Full Code Here

         buffer.readerIndex(MessageImpl.BUFFER_HEADER_SPACE + DataConstants.SIZE_INT);
         byte[] data = new byte[size];
         if (serverMessage.containsProperty(Stomp.Headers.CONTENT_LENGTH) || serverMessage.getType() == Message.BYTES_TYPE)
         {
            headers.put(Headers.CONTENT_LENGTH, data.length);
            buffer.readBytes(data);
         }
         else
         {
            SimpleString text = buffer.readNullableSimpleString();
            if (text != null)
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.