Examples of readerIndex()


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

      buffer.setInt(0, len);
      buffer.setByte(DataConstants.SIZE_INT, type);
      buffer.setLong(DataConstants.SIZE_INT + DataConstants.SIZE_BYTE, channelID);

      // Position reader for reading by Netty
      buffer.readerIndex(0);

      message.resetCopied();

      return buffer;
   }
View Full Code Here

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

      buffer.setInt(0, len);
      buffer.setByte(DataConstants.SIZE_INT, getType());
      buffer.setLong(DataConstants.SIZE_INT + DataConstants.SIZE_BYTE, channelID);

      // Position reader for reading by Netty
      buffer.readerIndex(0);

      message.resetCopied();

      return buffer;
   }
View Full Code Here

Examples of org.hornetq.core.client.impl.LargeMessageBufferImpl.readerIndex()

      Assert.assertEquals(str1, readBuffer.readUTF());
      Assert.assertEquals(str2, readBuffer.readString());
      Assert.assertEquals(d1, readBuffer.readDouble());
      Assert.assertEquals(f1, readBuffer.readFloat());

      readBuffer.readerIndex(0);

      Assert.assertEquals(str1, readBuffer.readUTF());
      Assert.assertEquals(str2, readBuffer.readString());
      Assert.assertEquals(d1, readBuffer.readDouble());
      Assert.assertEquals(f1, readBuffer.readFloat());
View Full Code Here

Examples of org.hornetq.core.client.impl.LargeMessageControllerImpl.readerIndex()

      Assert.assertEquals(str1, readBuffer.readUTF());
      Assert.assertEquals(str2, readBuffer.readString());
      Assert.assertEquals(d1, readBuffer.readDouble());
      Assert.assertEquals(f1, readBuffer.readFloat());

      readBuffer.readerIndex(0);

      Assert.assertEquals(str1, readBuffer.readUTF());
      Assert.assertEquals(str2, readBuffer.readString());
      Assert.assertEquals(d1, readBuffer.readDouble());
      Assert.assertEquals(f1, readBuffer.readFloat());
View Full Code Here

Examples of org.hornetq.core.client.impl.LargeMessageControllerImpl.readerIndex()

               buffer[j] = getSamplebyte(count++);
            }
            outBuffer.addPacket(new FakePacket(1, buffer, true, false));
         }

         outBuffer.readerIndex(0);

         for (int i = 0; i < 10240 * 10; i++)
         {
            assertEquals("position " + i, getSamplebyte(i), outBuffer.readByte());
         }
View Full Code Here

Examples of org.hornetq.core.client.impl.LargeMessageControllerImpl.readerIndex()

         for (int i = 0; i < 10240 * 10; i++)
         {
            assertEquals("position " + i, getSamplebyte(i), outBuffer.readByte());
         }

         outBuffer.readerIndex(0);

         for (int i = 0; i < 10240 * 10; i++)
         {
            assertEquals("position " + i, getSamplebyte(i), outBuffer.readByte());
         }
View Full Code Here

Examples of org.jboss.netty.buffer.BigEndianHeapChannelBuffer.readerIndex()

    @Override
    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
        BigEndianHeapChannelBuffer message = (BigEndianHeapChannelBuffer) e.getMessage();
        // System.out.println("messageReceived " + ctx.getChannel() + message.readableBytes());
        received += message.readableBytes();
        digest.update(message.array(), message.readerIndex(), message.readableBytes());
        if (received > maxLength) {
            System.out.println("messageReceived tid=" + Thread.currentThread().getId()
                    + " " + id + " got " + received);
            ctx.getChannel().close();
        }
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.readerIndex()

                return;

            }
            final ChannelBuffer buffer = (ChannelBuffer) msg;
            final byte[] payload = new byte[buffer.readableBytes()];
            buffer.toByteBuffer().get(payload, buffer.readerIndex(), buffer.readableBytes());

            final RawMessage raw = new RawMessage(input.getCodec().getName(), input.getId(),
                                                  (InetSocketAddress) e.getRemoteAddress(), payload);
            input.processRawMessage(raw);
        }
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.readerIndex()

            }
        }
        if (buffer != null) {
            response.setContent(buffer);
            // We just need to reset the readerIndex this time
            if (buffer.readerIndex() == buffer.writerIndex()) {
                buffer.setIndex(0, buffer.writerIndex());
            }
            // TODO How to enable the chunk transport
            int len = buffer.readableBytes();
            // set content-length
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.readerIndex()

            }
        }
        if (buffer != null) {
            response.setContent(buffer);
            // We just need to reset the readerIndex this time
            if (buffer.readerIndex() == buffer.writerIndex()) {
                buffer.setIndex(0, buffer.writerIndex());
            }
            // TODO How to enable the chunk transport
            int len = buffer.readableBytes();
            // set content-length
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.