public final class ResetLimitWrappedActiveMQBuffer extends ChannelBufferWrapper
buffer
Constructor and Description |
---|
ResetLimitWrappedActiveMQBuffer(int limit,
ActiveMQBuffer buffer,
Message message) |
ResetLimitWrappedActiveMQBuffer(int limit,
io.netty.buffer.ByteBuf buffer,
Message 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 |
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(Message 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, writerIndex
public ResetLimitWrappedActiveMQBuffer(int limit, ActiveMQBuffer buffer, Message message)
public ResetLimitWrappedActiveMQBuffer(int limit, io.netty.buffer.ByteBuf buffer, Message message)
public void setMessage(Message message)
message
- public void clear()
ActiveMQBuffer
readerIndex
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 ActiveMQBuffer
clear
in class ChannelBufferWrapper
public void readerIndex(int readerIndex)
ActiveMQBuffer
readerIndex
of this buffer.readerIndex
in interface ActiveMQBuffer
readerIndex
in class ChannelBufferWrapper
readerIndex
- The reader's indexpublic void resetReaderIndex()
ActiveMQBuffer
readerIndex
to the marked
readerIndex
in this buffer.resetReaderIndex
in interface ActiveMQBuffer
resetReaderIndex
in class ChannelBufferWrapper
public void resetWriterIndex()
ActiveMQBuffer
writerIndex
to the marked
writerIndex
in this buffer.resetWriterIndex
in interface ActiveMQBuffer
resetWriterIndex
in class ChannelBufferWrapper
public void setIndex(int readerIndex, int writerIndex)
ActiveMQBuffer
readerIndex
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 ActiveMQBuffer
setIndex
in class ChannelBufferWrapper
readerIndex
- The reader's indexwriterIndex
- The writer's indexpublic void writerIndex(int writerIndex)
ActiveMQBuffer
writerIndex
of this buffer.writerIndex
in interface ActiveMQBuffer
writerIndex
in class ChannelBufferWrapper
writerIndex
- The writer's indexpublic void setByte(int index, byte value)
ActiveMQBuffer
index
in this
buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.setByte
in interface ActiveMQBuffer
setByte
in class ChannelBufferWrapper
index
- Index into the buffervalue
- The specified bytepublic void setBytes(int index, byte[] src, int srcIndex, int length)
ActiveMQBuffer
index
.
This method does not modify readerIndex
or writerIndex
of
this buffer.setBytes
in interface ActiveMQBuffer
setBytes
in class ChannelBufferWrapper
index
- Index into the buffersrc
- The source buffersrcIndex
- The source buffer indexlength
- The number of bytes to transferpublic void setBytes(int index, byte[] src)
ActiveMQBuffer
index
.
This method does not modify readerIndex
or writerIndex
of
this buffer.setBytes
in interface ActiveMQBuffer
setBytes
in class ChannelBufferWrapper
index
- Index into the buffersrc
- The source bufferpublic void setBytes(int index, ByteBuffer src)
ActiveMQBuffer
index
until the source buffer's position
reaches its limit.
This method does not modify readerIndex
or writerIndex
of
this buffer.setBytes
in interface ActiveMQBuffer
setBytes
in class ChannelBufferWrapper
index
- Index into the buffersrc
- The source bufferpublic void setBytes(int index, ActiveMQBuffer src, int srcIndex, int length)
ActiveMQBuffer
index
.
This method does not modify readerIndex
or writerIndex
of both the source (i.e. this
) and the destination.setBytes
in interface ActiveMQBuffer
setBytes
in class ChannelBufferWrapper
index
- 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)
ActiveMQBuffer
index
. 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 ActiveMQBuffer
setBytes
in class ChannelBufferWrapper
index
- Index into the buffersrc
- The source bufferlength
- the number of bytes to transferpublic void setBytes(int index, ActiveMQBuffer src)
ActiveMQBuffer
index
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 ActiveMQBuffer
setBytes
in class ChannelBufferWrapper
index
- Index into the buffersrc
- The source bufferpublic void setChar(int index, char value)
ActiveMQBuffer
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.setChar
in interface ActiveMQBuffer
setChar
in class ChannelBufferWrapper
index
- Index into the buffervalue
- The specified charpublic void setDouble(int index, double value)
ActiveMQBuffer
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.setDouble
in interface ActiveMQBuffer
setDouble
in class ChannelBufferWrapper
index
- Index into the buffervalue
- The specified doublepublic void setFloat(int index, float value)
ActiveMQBuffer
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.setFloat
in interface ActiveMQBuffer
setFloat
in class ChannelBufferWrapper
index
- Index into the buffervalue
- The specified floatpublic void setInt(int index, int value)
ActiveMQBuffer
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.setInt
in interface ActiveMQBuffer
setInt
in class ChannelBufferWrapper
index
- Index into the buffervalue
- The specified 32-bit integerpublic void setLong(int index, long value)
ActiveMQBuffer
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.setLong
in interface ActiveMQBuffer
setLong
in class ChannelBufferWrapper
index
- Index into the buffervalue
- The specified 64-bit long integerpublic void setShort(int index, short value)
ActiveMQBuffer
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.setShort
in interface ActiveMQBuffer
setShort
in class ChannelBufferWrapper
index
- Index into the buffervalue
- The specified 16-bit short integerpublic void writeBoolean(boolean val)
ActiveMQBuffer
writerIndex
writeBoolean
in interface ActiveMQBuffer
writeBoolean
in class ChannelBufferWrapper
val
- The specified booleanpublic void writeByte(byte value)
ActiveMQBuffer
writerIndex
and increases the writerIndex
by 1
in this buffer.writeByte
in interface ActiveMQBuffer
writeByte
in class ChannelBufferWrapper
value
- The specified bytepublic void writeBytes(byte[] src, int srcIndex, int length)
ActiveMQBuffer
writerIndex
and increases the writerIndex
by the number of the transferred bytes (= length
).writeBytes
in interface ActiveMQBuffer
writeBytes
in class ChannelBufferWrapper
src
- The source buffersrcIndex
- the first index of the sourcelength
- the number of bytes to transferpublic void writeBytes(byte[] src)
ActiveMQBuffer
writerIndex
and increases the writerIndex
by the number of the transferred bytes (= src.length
).writeBytes
in interface ActiveMQBuffer
writeBytes
in class ChannelBufferWrapper
src
- The source bufferpublic void writeBytes(ByteBuffer src)
ActiveMQBuffer
writerIndex
until the source buffer's position
reaches its limit, and increases the writerIndex
by the
number of the transferred bytes.writeBytes
in interface ActiveMQBuffer
writeBytes
in class ChannelBufferWrapper
src
- The source bufferpublic void writeBytes(io.netty.buffer.ByteBuf src, int srcIndex, int length)
ActiveMQBuffer
writerIndex
until the source buffer's position
reaches its limit, and increases the writerIndex
by the
number of the transferred bytes.writeBytes
in interface ActiveMQBuffer
writeBytes
in class ChannelBufferWrapper
src
- The source bufferpublic void writeBytes(ActiveMQBuffer src, int srcIndex, int length)
ActiveMQBuffer
writerIndex
and increases the writerIndex
by the number of the transferred bytes (= length
).writeBytes
in interface ActiveMQBuffer
writeBytes
in class ChannelBufferWrapper
src
- The source buffersrcIndex
- the first index of the sourcelength
- the number of bytes to transferpublic void writeBytes(ActiveMQBuffer src, int length)
ActiveMQBuffer
writerIndex
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 ActiveMQBuffer
writeBytes
in class ChannelBufferWrapper
src
- The source bufferlength
- the number of bytes to transferpublic void writeChar(char chr)
ActiveMQBuffer
writerIndex
and increases the writerIndex
by 2
in this buffer.writeChar
in interface ActiveMQBuffer
writeChar
in class ChannelBufferWrapper
chr
- The specified charpublic void writeDouble(double value)
ActiveMQBuffer
writerIndex
and increases the writerIndex
by 8
in this buffer.writeDouble
in interface ActiveMQBuffer
writeDouble
in class ChannelBufferWrapper
value
- The specified doublepublic void writeFloat(float value)
ActiveMQBuffer
writerIndex
and increases the writerIndex
by 4
in this buffer.writeFloat
in interface ActiveMQBuffer
writeFloat
in class ChannelBufferWrapper
value
- The specified floatpublic void writeInt(int value)
ActiveMQBuffer
writerIndex
and increases the writerIndex
by 4
in this buffer.writeInt
in interface ActiveMQBuffer
writeInt
in class ChannelBufferWrapper
value
- The specified 32-bit integerpublic void writeLong(long value)
ActiveMQBuffer
writerIndex
and increases the writerIndex
by 8
in this buffer.writeLong
in interface ActiveMQBuffer
writeLong
in class ChannelBufferWrapper
value
- The specified 64-bit long integerpublic void writeNullableSimpleString(SimpleString val)
ActiveMQBuffer
null
) at the current writerIndex
writeNullableSimpleString
in interface ActiveMQBuffer
writeNullableSimpleString
in class ChannelBufferWrapper
val
- The specified SimpleStringpublic void writeNullableString(String val)
ActiveMQBuffer
null
) at the current writerIndex
writeNullableString
in interface ActiveMQBuffer
writeNullableString
in class ChannelBufferWrapper
val
- The specified Stringpublic void writeShort(short value)
ActiveMQBuffer
writerIndex
and increases the writerIndex
by 2
in this buffer.writeShort
in interface ActiveMQBuffer
writeShort
in class ChannelBufferWrapper
value
- The specified 16-bit short integerpublic void writeSimpleString(SimpleString val)
ActiveMQBuffer
writerIndex
writeSimpleString
in interface ActiveMQBuffer
writeSimpleString
in class ChannelBufferWrapper
val
- The specified non-null SimpleStringpublic void writeString(String val)
ActiveMQBuffer
writerIndex
writeString
in interface ActiveMQBuffer
writeString
in class ChannelBufferWrapper
val
- The specified non-null Stringpublic void writeUTF(String utf)
ActiveMQBuffer
writerIndex
writeUTF
in interface ActiveMQBuffer
writeUTF
in class ChannelBufferWrapper
utf
- The specified UTF-8 StringCopyright © 2019 JBoss by Red Hat. All rights reserved.