public final class ResetLimitWrappedActiveMQBuffer extends ChannelBufferWrapper
buffer| Constructor and Description |
|---|
ResetLimitWrappedActiveMQBuffer(int limit,
ActiveMQBuffer buffer,
MessageInternal message) |
ResetLimitWrappedActiveMQBuffer(int limit,
io.netty.buffer.ByteBuf buffer,
MessageInternal message) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Sets the
readerIndex and writerIndex of this buffer to
0. |
void |
readerIndex(int readerIndex)
Sets the
readerIndex of this buffer. |
void |
resetReaderIndex()
Repositions the current
readerIndex to the marked
readerIndex in this buffer. |
void |
resetWriterIndex()
Repositions the current
writerIndex to the marked
writerIndex in this buffer. |
void |
setBuffer(ActiveMQBuffer buffer) |
void |
setByte(int index,
byte value)
Sets the specified byte at the specified absolute
index in this
buffer. |
void |
setBytes(int index,
ActiveMQBuffer src)
Transfers the specified source buffer's data to this buffer starting at
the specified absolute
index until the destination becomes
unreadable. |
void |
setBytes(int index,
ActiveMQBuffer src,
int length)
Transfers the specified source buffer's data to this buffer starting at
the specified absolute
index. |
void |
setBytes(int index,
ActiveMQBuffer src,
int srcIndex,
int length)
Transfers the specified source buffer's data to this buffer starting at
the specified absolute
index. |
void |
setBytes(int index,
byte[] src)
Transfers the specified source array's data to this buffer starting at
the specified absolute
index. |
void |
setBytes(int index,
byte[] src,
int srcIndex,
int length)
Transfers the specified source array's data to this buffer starting at
the specified absolute
index. |
void |
setBytes(int index,
ByteBuffer src)
Transfers the specified source buffer's data to this buffer starting at
the specified absolute
index until the source buffer's position
reaches its limit. |
void |
setChar(int index,
char value)
Sets the specified char at the specified absolute
index in this buffer. |
void |
setDouble(int index,
double value)
Sets the specified double at the specified absolute
index in this buffer. |
void |
setFloat(int index,
float value)
Sets the specified float at the specified absolute
index in this buffer. |
void |
setIndex(int readerIndex,
int writerIndex)
Sets the
readerIndex and writerIndex of this buffer
in one shot. |
void |
setInt(int index,
int value)
Sets the specified 32-bit integer at the specified absolute
index in this buffer. |
void |
setLong(int index,
long value)
Sets the specified 64-bit long integer at the specified absolute
index in this buffer. |
void |
setMessage(MessageInternal message)
We need to turn of notifications of body changes on reset on the server side when dealing with AMQP conversions,
for that reason this method will set the message to null here
|
void |
setShort(int index,
short value)
Sets the specified 16-bit short integer at the specified absolute
index in this buffer. |
void |
writeBoolean(boolean val)
Sets the specified boolean at the current
writerIndex |
void |
writeByte(byte value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
void |
writeBytes(ActiveMQBuffer src,
int length)
Transfers the specified source buffer's data to this buffer starting at
the current
writerIndex and increases the writerIndex
by the number of the transferred bytes (= length). |
void |
writeBytes(ActiveMQBuffer src,
int srcIndex,
int length)
Transfers the specified source buffer's data to this buffer starting at
the current
writerIndex and increases the writerIndex
by the number of the transferred bytes (= length). |
void |
writeBytes(byte[] src)
Transfers the specified source array's data to this buffer starting at
the current
writerIndex and increases the writerIndex
by the number of the transferred bytes (= src.length). |
void |
writeBytes(byte[] src,
int srcIndex,
int length)
Transfers the specified source array's data to this buffer starting at
the current
writerIndex and increases the writerIndex
by the number of the transferred bytes (= length). |
void |
writeBytes(ByteBuffer src)
Transfers the specified source buffer's data to this buffer starting at
the current
writerIndex until the source buffer's position
reaches its limit, and increases the writerIndex by the
number of the transferred bytes. |
void |
writeBytes(io.netty.buffer.ByteBuf src,
int srcIndex,
int length)
Transfers the specified source buffer's data to this buffer starting at
the current
writerIndex until the source buffer's position
reaches its limit, and increases the writerIndex by the
number of the transferred bytes. |
void |
writeChar(char chr)
Sets the specified char at the current
writerIndex
and increases the writerIndex by 2 in this buffer. |
void |
writeDouble(double value)
Sets the specified double at the current
writerIndex
and increases the writerIndex by 8 in this buffer. |
void |
writeFloat(float value)
Sets the specified float at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
void |
writeInt(int value)
Sets the specified 32-bit integer at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
void |
writeLong(long value)
Sets the specified 64-bit long integer at the current
writerIndex and increases the writerIndex by 8
in this buffer. |
void |
writeNullableSimpleString(SimpleString val)
Sets the specified SimpleString (potentially
null) at the current writerIndex |
void |
writeNullableString(String val)
Sets the specified String (potentially
null) at the current writerIndex |
void |
writerIndex(int writerIndex)
Sets the
writerIndex of this buffer. |
void |
writeShort(short value)
Sets the specified 16-bit short integer at the current
writerIndex and increases the writerIndex by 2
in this buffer. |
void |
writeSimpleString(SimpleString val)
Sets the specified non-null SimpleString at the current
writerIndex |
void |
writeString(String val)
Sets the specified non-null String at the current
writerIndex |
void |
writeUTF(String utf)
Sets the specified UTF-8 String at the current
writerIndex |
byteBuf, capacity, copy, copy, discardReadBytes, duplicate, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getChar, getDouble, getFloat, getInt, getLong, getShort, getUnsignedByte, getUnsignedInt, getUnsignedShort, markReaderIndex, markWriterIndex, readable, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readDouble, readerIndex, readFloat, readFully, readFully, readInt, readLine, readLong, readNullableSimpleString, readNullableString, readShort, readSimpleString, readSlice, readString, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, release, skipBytes, slice, slice, toByteBuffer, toByteBuffer, unwrap, writable, writableBytes, writerIndexpublic ResetLimitWrappedActiveMQBuffer(int limit,
ActiveMQBuffer buffer,
MessageInternal message)
public ResetLimitWrappedActiveMQBuffer(int limit,
io.netty.buffer.ByteBuf buffer,
MessageInternal message)
public void setMessage(MessageInternal message)
message - public void setBuffer(ActiveMQBuffer buffer)
public void clear()
ActiveMQBufferreaderIndex and writerIndex of this buffer to
0.
This method is identical to setIndex(0, 0).
Please note that the behavior of this method is different
from that of NIO buffer, which sets the limit to
the capacity of the buffer.
clear in interface ActiveMQBufferclear in class ChannelBufferWrapperpublic void readerIndex(int readerIndex)
ActiveMQBufferreaderIndex of this buffer.readerIndex in interface ActiveMQBufferreaderIndex in class ChannelBufferWrapperreaderIndex - The reader's index The reader infexpublic void resetReaderIndex()
ActiveMQBufferreaderIndex to the marked
readerIndex in this buffer.resetReaderIndex in interface ActiveMQBufferresetReaderIndex in class ChannelBufferWrapperpublic void resetWriterIndex()
ActiveMQBufferwriterIndex to the marked
writerIndex in this buffer.resetWriterIndex in interface ActiveMQBufferresetWriterIndex in class ChannelBufferWrapperpublic void setIndex(int readerIndex,
int writerIndex)
ActiveMQBufferreaderIndex and writerIndex of this buffer
in one shot. This method is useful when you have to worry about the
invocation order of ActiveMQBuffer.readerIndex(int) and ActiveMQBuffer.writerIndex(int)
methods. For example, the following code will fail:
// Create a buffer whose readerIndex, writerIndex and capacity are // 0, 0 and 8 respectively. ChannelBuffer buf = ChannelBuffers.buffer(8); // IndexOutOfBoundsException is thrown because the specified // readerIndex (2) cannot be greater than the current writerIndex (0). buf.readerIndex(2); buf.writerIndex(4);The following code will also fail:
// Create a buffer whose readerIndex, writerIndex and capacity are // 0, 8 and 8 respectively. ChannelBuffer buf = ChannelBuffers.wrappedBuffer(new byte[8]); // readerIndex becomes 8. buf.readLong(); // IndexOutOfBoundsException is thrown because the specified // writerIndex (4) cannot be less than the current readerIndex (8). buf.writerIndex(4); buf.readerIndex(2);By contrast,
ActiveMQBuffer.setIndex(int, int) guarantees that it never
throws an IndexOutOfBoundsException as long as the specified
indexes meet basic constraints, regardless what the current index
values of the buffer are:
// No matter what the current state of the buffer is, the following // call always succeeds as long as the capacity of the buffer is not // less than 4. buf.setIndex(2, 4);
setIndex in interface ActiveMQBuffersetIndex in class ChannelBufferWrapperreaderIndex - The reader's indexwriterIndex - The writer's indexpublic void writerIndex(int writerIndex)
ActiveMQBufferwriterIndex of this buffer.writerIndex in interface ActiveMQBufferwriterIndex in class ChannelBufferWrapperwriterIndex - The writer's indexpublic void setByte(int index,
byte value)
ActiveMQBufferindex in this
buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setByte in interface ActiveMQBuffersetByte in class ChannelBufferWrapperindex - Index into the buffervalue - The specified bytepublic void setBytes(int index,
byte[] src,
int srcIndex,
int length)
ActiveMQBufferindex.
This method does not modify readerIndex or writerIndex of
this buffer.setBytes in interface ActiveMQBuffersetBytes in class ChannelBufferWrapperindex - Index into the buffersrc - The source buffersrcIndex - The source buffer indexlength - The number of bytes to transferpublic void setBytes(int index,
byte[] src)
ActiveMQBufferindex.
This method does not modify readerIndex or writerIndex of
this buffer.setBytes in interface ActiveMQBuffersetBytes in class ChannelBufferWrapperindex - Index into the buffersrc - The source bufferpublic void setBytes(int index,
ByteBuffer src)
ActiveMQBufferindex until the source buffer's position
reaches its limit.
This method does not modify readerIndex or writerIndex of
this buffer.setBytes in interface ActiveMQBuffersetBytes in class ChannelBufferWrapperindex - Index into the buffersrc - The source bufferpublic void setBytes(int index,
ActiveMQBuffer src,
int srcIndex,
int length)
ActiveMQBufferindex.
This method does not modify readerIndex or writerIndex
of both the source (i.e. this) and the destination.setBytes in interface ActiveMQBuffersetBytes in class ChannelBufferWrapperindex - Index into the buffersrc - The source bufferIndex the first index of the sourcesrcIndex - The source buffer indexlength - The number of bytes to transferpublic void setBytes(int index,
ActiveMQBuffer src,
int length)
ActiveMQBufferindex. This method is basically same
with ActiveMQBuffer.setBytes(int, ActiveMQBuffer, int, int), except that this
method increases the readerIndex of the source buffer by
the number of the transferred bytes while
ActiveMQBuffer.getBytes(int, ActiveMQBuffer, int, int) does not.
This method does not modify readerIndex or writerIndex of
the source buffer (i.e. this).setBytes in interface ActiveMQBuffersetBytes in class ChannelBufferWrapperindex - Index into the buffersrc - The source bufferlength - the number of bytes to transferpublic void setBytes(int index,
ActiveMQBuffer src)
ActiveMQBufferindex until the destination becomes
unreadable. This method is basically same with
ActiveMQBuffer.setBytes(int, ActiveMQBuffer, int, int), except that this
method increases the readerIndex of the source buffer by
the number of the transferred bytes while
ActiveMQBuffer.getBytes(int, ActiveMQBuffer, int, int) does not.
This method does not modify readerIndex or writerIndex of
the source buffer (i.e. this).setBytes in interface ActiveMQBuffersetBytes in class ChannelBufferWrapperindex - Index into the buffersrc - The source bufferpublic void setChar(int index,
char value)
ActiveMQBufferindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setChar in interface ActiveMQBuffersetChar in class ChannelBufferWrapperindex - Index into the buffervalue - The specified charpublic void setDouble(int index,
double value)
ActiveMQBufferindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setDouble in interface ActiveMQBuffersetDouble in class ChannelBufferWrapperindex - Index into the buffervalue - The specified doublepublic void setFloat(int index,
float value)
ActiveMQBufferindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setFloat in interface ActiveMQBuffersetFloat in class ChannelBufferWrapperindex - Index into the buffervalue - The specified floatpublic void setInt(int index,
int value)
ActiveMQBufferindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setInt in interface ActiveMQBuffersetInt in class ChannelBufferWrapperindex - Index into the buffervalue - The specified 32-bit integerpublic void setLong(int index,
long value)
ActiveMQBufferindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setLong in interface ActiveMQBuffersetLong in class ChannelBufferWrapperindex - Index into the buffervalue - The specified 64-bit long integerpublic void setShort(int index,
short value)
ActiveMQBufferindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setShort in interface ActiveMQBuffersetShort in class ChannelBufferWrapperindex - Index into the buffervalue - The specified 16-bit short integerpublic void writeBoolean(boolean val)
ActiveMQBufferwriterIndexwriteBoolean in interface ActiveMQBufferwriteBoolean in class ChannelBufferWrapperval - The specified booleanpublic void writeByte(byte value)
ActiveMQBufferwriterIndex
and increases the writerIndex by 1 in this buffer.writeByte in interface ActiveMQBufferwriteByte in class ChannelBufferWrappervalue - The specified bytepublic void writeBytes(byte[] src,
int srcIndex,
int length)
ActiveMQBufferwriterIndex and increases the writerIndex
by the number of the transferred bytes (= length).writeBytes in interface ActiveMQBufferwriteBytes in class ChannelBufferWrappersrc - The source buffersrcIndex - the first index of the sourcelength - the number of bytes to transferpublic void writeBytes(byte[] src)
ActiveMQBufferwriterIndex and increases the writerIndex
by the number of the transferred bytes (= src.length).writeBytes in interface ActiveMQBufferwriteBytes in class ChannelBufferWrappersrc - The source bufferpublic void writeBytes(ByteBuffer src)
ActiveMQBufferwriterIndex until the source buffer's position
reaches its limit, and increases the writerIndex by the
number of the transferred bytes.writeBytes in interface ActiveMQBufferwriteBytes in class ChannelBufferWrappersrc - The source bufferpublic void writeBytes(io.netty.buffer.ByteBuf src,
int srcIndex,
int length)
ActiveMQBufferwriterIndex until the source buffer's position
reaches its limit, and increases the writerIndex by the
number of the transferred bytes.writeBytes in interface ActiveMQBufferwriteBytes in class ChannelBufferWrappersrc - The source bufferpublic void writeBytes(ActiveMQBuffer src, int srcIndex, int length)
ActiveMQBufferwriterIndex and increases the writerIndex
by the number of the transferred bytes (= length).writeBytes in interface ActiveMQBufferwriteBytes in class ChannelBufferWrappersrc - The source buffersrcIndex - the first index of the sourcelength - the number of bytes to transferpublic void writeBytes(ActiveMQBuffer src, int length)
ActiveMQBufferwriterIndex and increases the writerIndex
by the number of the transferred bytes (= length). This method
is basically same with ActiveMQBuffer.writeBytes(ActiveMQBuffer, int, int),
except that this method increases the readerIndex of the source
buffer by the number of the transferred bytes (= length) while
ActiveMQBuffer.writeBytes(ActiveMQBuffer, int, int) does not.writeBytes in interface ActiveMQBufferwriteBytes in class ChannelBufferWrappersrc - The source bufferlength - the number of bytes to transferpublic void writeChar(char chr)
ActiveMQBufferwriterIndex
and increases the writerIndex by 2 in this buffer.writeChar in interface ActiveMQBufferwriteChar in class ChannelBufferWrapperchr - The specified charpublic void writeDouble(double value)
ActiveMQBufferwriterIndex
and increases the writerIndex by 8 in this buffer.writeDouble in interface ActiveMQBufferwriteDouble in class ChannelBufferWrappervalue - The specified doublepublic void writeFloat(float value)
ActiveMQBufferwriterIndex
and increases the writerIndex by 4 in this buffer.writeFloat in interface ActiveMQBufferwriteFloat in class ChannelBufferWrappervalue - The specified floatpublic void writeInt(int value)
ActiveMQBufferwriterIndex
and increases the writerIndex by 4 in this buffer.writeInt in interface ActiveMQBufferwriteInt in class ChannelBufferWrappervalue - The specified 32-bit integerpublic void writeLong(long value)
ActiveMQBufferwriterIndex and increases the writerIndex by 8
in this buffer.writeLong in interface ActiveMQBufferwriteLong in class ChannelBufferWrappervalue - The specified 64-bit long integerpublic void writeNullableSimpleString(SimpleString val)
ActiveMQBuffernull) at the current writerIndexwriteNullableSimpleString in interface ActiveMQBufferwriteNullableSimpleString in class ChannelBufferWrapperval - The specified SimpleStringpublic void writeNullableString(String val)
ActiveMQBuffernull) at the current writerIndexwriteNullableString in interface ActiveMQBufferwriteNullableString in class ChannelBufferWrapperval - The specified Stringpublic void writeShort(short value)
ActiveMQBufferwriterIndex and increases the writerIndex by 2
in this buffer.writeShort in interface ActiveMQBufferwriteShort in class ChannelBufferWrappervalue - The specified 16-bit short integerpublic void writeSimpleString(SimpleString val)
ActiveMQBufferwriterIndexwriteSimpleString in interface ActiveMQBufferwriteSimpleString in class ChannelBufferWrapperval - The specified non-null SimpleStringpublic void writeString(String val)
ActiveMQBufferwriterIndexwriteString in interface ActiveMQBufferwriteString in class ChannelBufferWrapperval - The specified non-null Stringpublic void writeUTF(String utf)
ActiveMQBufferwriterIndexwriteUTF in interface ActiveMQBufferwriteUTF in class ChannelBufferWrapperutf - The specified UTF-8 StringCopyright © 2018 JBoss by Red Hat. All rights reserved.