Package org.hornetq.api.core

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


         HornetQBuffer buffer = serverMessage.getBodyBuffer();
  
         int bodyPos = serverMessage.getEndOfBodyPosition() == -1 ? buffer.writerIndex()
                                                                 : serverMessage.getEndOfBodyPosition();
         int size = bodyPos - buffer.readerIndex();
         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);
View Full Code Here


     
      HornetQBuffer buffer = serverMessage.getBodyBufferCopy();

      int bodyPos = serverMessage.getEndOfBodyPosition() == -1 ? buffer.writerIndex()
                                                              : serverMessage.getEndOfBodyPosition();
      int size = bodyPos - buffer.readerIndex();
      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);
View Full Code Here

      HornetQBuffer buffer = serverMessage.getBodyBufferCopy();

      int bodyPos = serverMessage.getEndOfBodyPosition() == -1 ? buffer.writerIndex()
                                                              : serverMessage.getEndOfBodyPosition();
      int size = bodyPos - buffer.readerIndex();
      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);
View Full Code Here

         .writerIndex() : serverMessage.getEndOfBodyPosition();

      buffer.readerIndex(MessageImpl.BUFFER_HEADER_SPACE
                            + DataConstants.SIZE_INT);

      int size = bodyPos - buffer.readerIndex();

      byte[] data = new byte[size];

      if (serverMessage.containsProperty(Stomp.Headers.CONTENT_LENGTH)
         || serverMessage.getType() == Message.BYTES_TYPE)
View Full Code Here

      HornetQBuffer buffer = serverMessage.getBodyBufferCopy();

      int bodyPos = serverMessage.getEndOfBodyPosition() == -1 ? buffer
         .writerIndex() : serverMessage.getEndOfBodyPosition();

      buffer.readerIndex(MessageImpl.BUFFER_HEADER_SPACE
                            + DataConstants.SIZE_INT);

      int size = bodyPos - buffer.readerIndex();

      byte[] data = new byte[size];
View Full Code Here

      message.putStringProperty(new SimpleString("wibble"), new SimpleString("bong"));

      // Change the body
      HornetQBuffer buffer = message.getBodyBuffer();

      buffer.readerIndex(0);

      String str = buffer.readString();

      if (!str.equals("doo be doo be doo be doo"))
      {
View Full Code Here

         HornetQBuffer buffer = serverMessage.getBodyBuffer();

         int bodyPos = serverMessage.getEndOfBodyPosition() == -1 ? buffer
               .writerIndex() : serverMessage.getEndOfBodyPosition();

         buffer.readerIndex(MessageImpl.BUFFER_HEADER_SPACE
                     + DataConstants.SIZE_INT);
        
         int size = bodyPos - buffer.readerIndex();

         byte[] data = new byte[size];
View Full Code Here

               .writerIndex() : serverMessage.getEndOfBodyPosition();

         buffer.readerIndex(MessageImpl.BUFFER_HEADER_SPACE
                     + DataConstants.SIZE_INT);
        
         int size = bodyPos - buffer.readerIndex();

         byte[] data = new byte[size];

         if (serverMessage.containsProperty(Stomp.Headers.CONTENT_LENGTH)
               || serverMessage.getType() == Message.BYTES_TYPE)
View Full Code Here

      HornetQBuffer fileBuffer = HornetQBuffers.wrappedBuffer(buffer2);
      fileBuffer.writerIndex(fileBuffer.capacity());

      while (fileBuffer.readable())
      {
         final int position = fileBuffer.readerIndex();

         byte byteRead = fileBuffer.readByte();

         if (byteRead == PageImpl.START_BYTE)
         {
View Full Code Here

         byte byteRead = fileBuffer.readByte();

         if (byteRead == PageImpl.START_BYTE)
         {
            if (fileBuffer.readerIndex() + DataConstants.SIZE_INT < fileBuffer.capacity())
            {
               int messageSize = fileBuffer.readInt();
               int oldPos = fileBuffer.readerIndex();
               if (fileBuffer.readerIndex() + messageSize < fileBuffer.capacity() && fileBuffer.getByte(oldPos + messageSize) == PageImpl.END_BYTE)
               {
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.