public final class ResetLimitWrappedHornetQBuffer extends ChannelBufferWrapper
buffer| Constructor and Description |
|---|
ResetLimitWrappedHornetQBuffer(int limit,
HornetQBuffer 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(HornetQBuffer buffer) |
void |
setByte(int index,
byte value)
Sets the specified byte at the specified absolute
index in this
buffer. |
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 |
setBytes(int index,
HornetQBuffer 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,
HornetQBuffer src,
int length)
Transfers the specified source buffer's data to this buffer starting at
the specified absolute
index. |
void |
setBytes(int index,
HornetQBuffer src,
int srcIndex,
int length)
Transfers the specified source buffer's data to this buffer starting at
the specified absolute
index. |
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 |
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(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(HornetQBuffer 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(HornetQBuffer 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 |
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 |
capacity, channelBuffer, 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, readInt, readLong, readNullableSimpleString, readNullableString, readShort, readSimpleString, readSlice, readString, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, skipBytes, slice, slice, toByteBuffer, toByteBuffer, writable, writableBytes, writerIndexpublic ResetLimitWrappedHornetQBuffer(int limit,
HornetQBuffer buffer,
MessageInternal message)
public void setBuffer(HornetQBuffer buffer)
public void clear()
HornetQBufferreaderIndex 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 HornetQBufferclear in class ChannelBufferWrapperpublic void readerIndex(int readerIndex)
HornetQBufferreaderIndex of this buffer.readerIndex in interface HornetQBufferreaderIndex in class ChannelBufferWrapperpublic void resetReaderIndex()
HornetQBufferreaderIndex to the marked
readerIndex in this buffer.resetReaderIndex in interface HornetQBufferresetReaderIndex in class ChannelBufferWrapperpublic void resetWriterIndex()
HornetQBufferwriterIndex to the marked
writerIndex in this buffer.resetWriterIndex in interface HornetQBufferresetWriterIndex in class ChannelBufferWrapperpublic void setIndex(int readerIndex,
int writerIndex)
HornetQBufferreaderIndex and writerIndex of this buffer
in one shot. This method is useful when you have to worry about the
invocation order of HornetQBuffer.readerIndex(int) and HornetQBuffer.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,
HornetQBuffer.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 HornetQBuffersetIndex in class ChannelBufferWrapperpublic void writerIndex(int writerIndex)
HornetQBufferwriterIndex of this buffer.writerIndex in interface HornetQBufferwriterIndex in class ChannelBufferWrapperpublic void setByte(int index,
byte value)
HornetQBufferindex in this
buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setByte in interface HornetQBuffersetByte in class ChannelBufferWrapperpublic void setBytes(int index,
byte[] src,
int srcIndex,
int length)
HornetQBufferindex.
This method does not modify readerIndex or writerIndex of
this buffer.setBytes in interface HornetQBuffersetBytes in class ChannelBufferWrapperpublic void setBytes(int index,
byte[] src)
HornetQBufferindex.
This method does not modify readerIndex or writerIndex of
this buffer.setBytes in interface HornetQBuffersetBytes in class ChannelBufferWrapperpublic void setBytes(int index,
ByteBuffer src)
HornetQBufferindex until the source buffer's position
reaches its limit.
This method does not modify readerIndex or writerIndex of
this buffer.setBytes in interface HornetQBuffersetBytes in class ChannelBufferWrapperpublic void setBytes(int index,
HornetQBuffer src,
int srcIndex,
int length)
HornetQBufferindex.
This method does not modify readerIndex or writerIndex
of both the source (i.e. this) and the destination.setBytes in interface HornetQBuffersetBytes in class ChannelBufferWrappersrcIndex - the first index of the sourcelength - the number of bytes to transferpublic void setBytes(int index,
HornetQBuffer src,
int length)
HornetQBufferindex. This method is basically same
with HornetQBuffer.setBytes(int, HornetQBuffer, int, int), except that this
method increases the readerIndex of the source buffer by
the number of the transferred bytes while
HornetQBuffer.getBytes(int, HornetQBuffer, int, int) does not.
This method does not modify readerIndex or writerIndex of
the source buffer (i.e. this).setBytes in interface HornetQBuffersetBytes in class ChannelBufferWrapperlength - the number of bytes to transferpublic void setBytes(int index,
HornetQBuffer src)
HornetQBufferindex until the destination becomes
unreadable. This method is basically same with
HornetQBuffer.setBytes(int, HornetQBuffer, int, int), except that this
method increases the readerIndex of the source buffer by
the number of the transferred bytes while
HornetQBuffer.getBytes(int, HornetQBuffer, int, int) does not.
This method does not modify readerIndex or writerIndex of
the source buffer (i.e. this).setBytes in interface HornetQBuffersetBytes in class ChannelBufferWrapperpublic void setChar(int index,
char value)
HornetQBufferindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setChar in interface HornetQBuffersetChar in class ChannelBufferWrapperpublic void setDouble(int index,
double value)
HornetQBufferindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setDouble in interface HornetQBuffersetDouble in class ChannelBufferWrapperpublic void setFloat(int index,
float value)
HornetQBufferindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setFloat in interface HornetQBuffersetFloat in class ChannelBufferWrapperpublic void setInt(int index,
int value)
HornetQBufferindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setInt in interface HornetQBuffersetInt in class ChannelBufferWrapperpublic void setLong(int index,
long value)
HornetQBufferindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setLong in interface HornetQBuffersetLong in class ChannelBufferWrapperpublic void setShort(int index,
short value)
HornetQBufferindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.setShort in interface HornetQBuffersetShort in class ChannelBufferWrapperpublic void writeBoolean(boolean val)
HornetQBufferwriterIndexwriteBoolean in interface HornetQBufferwriteBoolean in class ChannelBufferWrapperpublic void writeByte(byte value)
HornetQBufferwriterIndex
and increases the writerIndex by 1 in this buffer.writeByte in interface HornetQBufferwriteByte in class ChannelBufferWrapperpublic void writeBytes(byte[] src,
int srcIndex,
int length)
HornetQBufferwriterIndex and increases the writerIndex
by the number of the transferred bytes (= length).writeBytes in interface HornetQBufferwriteBytes in class ChannelBufferWrappersrcIndex - the first index of the sourcelength - the number of bytes to transferpublic void writeBytes(byte[] src)
HornetQBufferwriterIndex and increases the writerIndex
by the number of the transferred bytes (= src.length).writeBytes in interface HornetQBufferwriteBytes in class ChannelBufferWrapperpublic void writeBytes(ByteBuffer src)
HornetQBufferwriterIndex until the source buffer's position
reaches its limit, and increases the writerIndex by the
number of the transferred bytes.writeBytes in interface HornetQBufferwriteBytes in class ChannelBufferWrapperpublic void writeBytes(HornetQBuffer src, int srcIndex, int length)
HornetQBufferwriterIndex and increases the writerIndex
by the number of the transferred bytes (= length).writeBytes in interface HornetQBufferwriteBytes in class ChannelBufferWrappersrcIndex - the first index of the sourcelength - the number of bytes to transferpublic void writeBytes(HornetQBuffer src, int length)
HornetQBufferwriterIndex and increases the writerIndex
by the number of the transferred bytes (= length). This method
is basically same with HornetQBuffer.writeBytes(HornetQBuffer, int, int),
except that this method increases the readerIndex of the source
buffer by the number of the transferred bytes (= length) while
HornetQBuffer.writeBytes(HornetQBuffer, int, int) does not.writeBytes in interface HornetQBufferwriteBytes in class ChannelBufferWrapperlength - the number of bytes to transferpublic void writeChar(char chr)
HornetQBufferwriterIndex
and increases the writerIndex by 2 in this buffer.writeChar in interface HornetQBufferwriteChar in class ChannelBufferWrapperpublic void writeDouble(double value)
HornetQBufferwriterIndex
and increases the writerIndex by 8 in this buffer.writeDouble in interface HornetQBufferwriteDouble in class ChannelBufferWrapperpublic void writeFloat(float value)
HornetQBufferwriterIndex
and increases the writerIndex by 4 in this buffer.writeFloat in interface HornetQBufferwriteFloat in class ChannelBufferWrapperpublic void writeInt(int value)
HornetQBufferwriterIndex
and increases the writerIndex by 4 in this buffer.writeInt in interface HornetQBufferwriteInt in class ChannelBufferWrapperpublic void writeLong(long value)
HornetQBufferwriterIndex and increases the writerIndex by 8
in this buffer.writeLong in interface HornetQBufferwriteLong in class ChannelBufferWrapperpublic void writeNullableSimpleString(SimpleString val)
HornetQBuffernull) at the current writerIndexwriteNullableSimpleString in interface HornetQBufferwriteNullableSimpleString in class ChannelBufferWrapperpublic void writeNullableString(String val)
HornetQBuffernull) at the current writerIndexwriteNullableString in interface HornetQBufferwriteNullableString in class ChannelBufferWrapperpublic void writeShort(short value)
HornetQBufferwriterIndex and increases the writerIndex by 2
in this buffer.writeShort in interface HornetQBufferwriteShort in class ChannelBufferWrapperpublic void writeSimpleString(SimpleString val)
HornetQBufferwriterIndexwriteSimpleString in interface HornetQBufferwriteSimpleString in class ChannelBufferWrapperpublic void writeString(String val)
HornetQBufferwriterIndexwriteString in interface HornetQBufferwriteString in class ChannelBufferWrapperpublic void writeUTF(String utf)
HornetQBufferwriterIndexwriteUTF in interface HornetQBufferwriteUTF in class ChannelBufferWrapperCopyright © 2013 JBoss, a division of Red Hat. All rights reserved.