public ResetLimitWrappedActiveMQBuffer(final int limit, final ByteBuf buffer, final Message message) { // a wrapped inside a wrapper will increase the stack size. // we fixed this here due to some profiling testing super(buffer); this.limit = limit; if (writerIndex() < limit) { writerIndex(limit); } readerIndex(limit); this.message = message; }
public synchronized CoreMessage encode() { checkProperties(); if (writableBuffer != null) { // The message encode takes into consideration the PacketImpl which is not part of this encoding // so we always need to take the BUFFER_HEADER_SPACE from packet impl into consideration endOfBodyPosition = writableBuffer.writerIndex() + BUFFER_HEADER_SPACE - 4; } else if (endOfBodyPosition <= 0) { endOfBodyPosition = BUFFER_HEADER_SPACE + DataConstants.SIZE_INT; } buffer.setIndex(0, 0); buffer.writeInt(endOfBodyPosition); // The end of body position buffer.writerIndex(endOfBodyPosition - BUFFER_HEADER_SPACE + DataConstants.SIZE_INT); encodeHeadersAndProperties(buffer); validBuffer = true; return this; }
public ResetLimitWrappedActiveMQBuffer(final int limit, final ByteBuf buffer, final Message message) { // a wrapped inside a wrapper will increase the stack size. // we fixed this here due to some profiling testing super(buffer); this.limit = limit; if (writerIndex() < limit) { writerIndex(limit); } readerIndex(limit); this.message = message; }
public ResetLimitWrappedActiveMQBuffer(final int limit, final ByteBuf buffer, final Message message) { // a wrapped inside a wrapper will increase the stack size. // we fixed this here due to some profiling testing super(buffer); this.limit = limit; if (writerIndex() < limit) { writerIndex(limit); } readerIndex(limit); this.message = message; }
public ResetLimitWrappedActiveMQBuffer(final int limit, final ByteBuf buffer, final Message message) { // a wrapped inside a wrapper will increase the stack size. // we fixed this here due to some profiling testing super(buffer); this.limit = limit; if (writerIndex() < limit) { writerIndex(limit); } readerIndex(limit); this.message = message; }
public ResetLimitWrappedActiveMQBuffer(final int limit, final ByteBuf buffer, final Message message) { // a wrapped inside a wrapper will increase the stack size. // we fixed this here due to some profiling testing super(buffer); this.limit = limit; if (writerIndex() < limit) { writerIndex(limit); } readerIndex(limit); this.message = message; }
public ResetLimitWrappedActiveMQBuffer(final int limit, final ByteBuf buffer, final Message message) { // a wrapped inside a wrapper will increase the stack size. // we fixed this here due to some profiling testing super(buffer); this.limit = limit; if (writerIndex() < limit) { writerIndex(limit); } readerIndex(limit); this.message = message; }
public ResetLimitWrappedActiveMQBuffer(final int limit, final ByteBuf buffer, final Message message) { // a wrapped inside a wrapper will increase the stack size. // we fixed this here due to some profiling testing super(buffer); this.limit = limit; if (writerIndex() < limit) { writerIndex(limit); } readerIndex(limit); this.message = message; }
public synchronized CoreMessage encode() { getProperties(); if (writableBuffer != null) { // The message encode takes into consideration the PacketImpl which is not part of this encoding // so we always need to take the BUFFER_HEADER_SPACE from packet impl into consideration endOfBodyPosition = writableBuffer.writerIndex() + BUFFER_HEADER_SPACE - 4; } else if (endOfBodyPosition <= 0) { endOfBodyPosition = BUFFER_HEADER_SPACE + DataConstants.SIZE_INT; } buffer.setIndex(0, 0); buffer.writeInt(endOfBodyPosition); // The end of body position buffer.writerIndex(endOfBodyPosition - BUFFER_HEADER_SPACE + DataConstants.SIZE_INT); encodeHeadersAndProperties(buffer); validBuffer = true; return this; }
public synchronized CoreMessage encode() { getProperties(); if (writableBuffer != null) { // The message encode takes into consideration the PacketImpl which is not part of this encoding // so we always need to take the BUFFER_HEADER_SPACE from packet impl into consideration endOfBodyPosition = writableBuffer.writerIndex() + BUFFER_HEADER_SPACE - 4; } else if (endOfBodyPosition <= 0) { endOfBodyPosition = BUFFER_HEADER_SPACE + DataConstants.SIZE_INT; } buffer.setIndex(0, 0); buffer.writeInt(endOfBodyPosition); // The end of body position buffer.writerIndex(endOfBodyPosition - BUFFER_HEADER_SPACE + DataConstants.SIZE_INT); encodeHeadersAndProperties(buffer); validBuffer = true; return this; }
public synchronized CoreMessage encode() { checkProperties(); if (writableBuffer != null) { // The message encode takes into consideration the PacketImpl which is not part of this encoding // so we always need to take the BUFFER_HEADER_SPACE from packet impl into consideration endOfBodyPosition = writableBuffer.writerIndex() + BUFFER_HEADER_SPACE - 4; } else if (endOfBodyPosition <= 0) { endOfBodyPosition = BUFFER_HEADER_SPACE + DataConstants.SIZE_INT; } buffer.setIndex(0, 0); buffer.writeInt(endOfBodyPosition); // The end of body position buffer.writerIndex(endOfBodyPosition - BUFFER_HEADER_SPACE + DataConstants.SIZE_INT); encodeHeadersAndProperties(buffer); validBuffer = true; return this; }
public synchronized CoreMessage encode() { checkProperties(); if (writableBuffer != null) { // The message encode takes into consideration the PacketImpl which is not part of this encoding // so we always need to take the BUFFER_HEADER_SPACE from packet impl into consideration endOfBodyPosition = writableBuffer.writerIndex() + BUFFER_HEADER_SPACE - 4; } else if (endOfBodyPosition <= 0) { endOfBodyPosition = BUFFER_HEADER_SPACE + DataConstants.SIZE_INT; } buffer.setIndex(0, 0); buffer.writeInt(endOfBodyPosition); // The end of body position buffer.writerIndex(endOfBodyPosition - BUFFER_HEADER_SPACE + DataConstants.SIZE_INT); encodeHeadersAndProperties(buffer); validBuffer = true; return this; }
public synchronized CoreMessage encode() { checkProperties(); if (writableBuffer != null) { // The message encode takes into consideration the PacketImpl which is not part of this encoding // so we always need to take the BUFFER_HEADER_SPACE from packet impl into consideration endOfBodyPosition = writableBuffer.writerIndex() + BUFFER_HEADER_SPACE - 4; } else if (endOfBodyPosition <= 0) { endOfBodyPosition = BUFFER_HEADER_SPACE + DataConstants.SIZE_INT; } buffer.setIndex(0, 0); buffer.writeInt(endOfBodyPosition); // The end of body position buffer.writerIndex(endOfBodyPosition - BUFFER_HEADER_SPACE + DataConstants.SIZE_INT); encodeHeadersAndProperties(buffer); validBuffer = true; return this; }
public synchronized CoreMessage encode() { getProperties(); if (writableBuffer != null) { // The message encode takes into consideration the PacketImpl which is not part of this encoding // so we always need to take the BUFFER_HEADER_SPACE from packet impl into consideration endOfBodyPosition = writableBuffer.writerIndex() + BUFFER_HEADER_SPACE - 4; } else if (endOfBodyPosition <= 0) { endOfBodyPosition = BUFFER_HEADER_SPACE + DataConstants.SIZE_INT; } buffer.setIndex(0, 0); buffer.writeInt(endOfBodyPosition); // The end of body position buffer.writerIndex(endOfBodyPosition - BUFFER_HEADER_SPACE + DataConstants.SIZE_INT); encodeHeadersAndProperties(buffer); validBuffer = true; return this; }