Package org.hornetq.api.core

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


         file.read(directBuffer);

         directBuffer.rewind();

         fileBuffer = HornetQBuffers.wrappedBuffer(directBuffer);
         fileBuffer.writerIndex(fileBuffer.capacity());

         while (fileBuffer.readable())
         {
            final int position = fileBuffer.readerIndex();
View Full Code Here


            byte byteRead = fileBuffer.readByte();

            if (byteRead == Page.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) == Page.END_BYTE)
View Full Code Here

            {
               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) == Page.END_BYTE)
                  {
                     PagedMessage msg = new PagedMessageImpl();
                     msg.decode(fileBuffer);
                     byte b = fileBuffer.readByte();
View Full Code Here

      final int size = 1234;

      HornetQBuffer buff = conn.createBuffer(size);
      buff.writeByte((byte)0x00); // Netty buffer does lazy initialization.
      Assert.assertEquals(size, buff.capacity());

   }

   private final class SimpleChannel implements Channel
   {
View Full Code Here

      file.read(buffer2);

      buffer2.rewind();

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

      while (fileBuffer.readable())
      {
         final int position = fileBuffer.readerIndex();
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

         {
            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)
               {
                  PagedMessage msg = new PagedMessageImpl();
                  msg.decode(fileBuffer);
                  byte b = fileBuffer.readByte();
                  if (b != PageImpl.END_BYTE)
View Full Code Here

   {
      HornetQBuffer buffer = HornetQBuffers.fixedBuffer(size + 8);

      buffer.writeLong(id);

      for (int j = 8; j < buffer.capacity(); j++)
      {
         buffer.writeByte((byte)66);
      }

      return buffer;
View Full Code Here

         HornetQBuffer buffer = msg.getBodyBuffer();

         SelfExpandingBufferTest.log.info("buffer is " + buffer);

         byte[] bytes = RandomUtil.randomBytes(10 * buffer.capacity());

         buffer.writeBytes(bytes);

         ClientProducer prod = session.createProducer(ADDRESS);

View Full Code Here

      TransportConfiguration config = new TransportConfiguration(NettyConnectorFactory.class.getName(), params);

      HornetQBuffer buffer = HornetQBuffers.fixedBuffer(TransportConfigurationEncodingSupport.getEncodeSize(config));
      TransportConfigurationEncodingSupport.encode(buffer, config);

      assertEquals(buffer.capacity(), buffer.writerIndex());
      buffer.readerIndex(0);

      TransportConfiguration decoded = TransportConfigurationEncodingSupport.decode(buffer);
      assertNotNull(decoded);
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.