-
- All Known Subinterfaces:
Buffer,CompositeBuffer
- All Known Implementing Classes:
AdaptableBuffer,BufferStub
public interface BufferAccessorThis interface is just the primitive data accessor methods thatBufferexposes. It can be useful if you only need the data access methods, and perhaps wish to decorate or modify their behaviour. Usually, you'd use theBufferinterface directly, since this lets you properly control the buffer life cycle.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleangetBoolean(int roff)Get the boolean value at the given reader offset.bytegetByte(int roff)Get the byte value at the given reader offset.chargetChar(int roff)Get the char value at the given reader offset.doublegetDouble(int roff)Get the double value at the given reader offset.floatgetFloat(int roff)Get the float value at the given reader offset.intgetInt(int roff)Get the int value at the given reader offset.longgetLong(int roff)Get the long value at the given reader offset.intgetMedium(int roff)Get the int value at the given reader offset.shortgetShort(int roff)Get the short value at the given reader offset.intgetUnsignedByte(int roff)Get the unsigned byte value at the given reader offset.longgetUnsignedInt(int roff)Get the unsigned int value at the given reader offset.intgetUnsignedMedium(int roff)Get the unsigned int value at the given reader offset.intgetUnsignedShort(int roff)Get the unsigned short value at the given reader offset.default booleanreadBoolean()Read the boolean value at the currentBuffer.readerOffset(), and increases the reader offset byByte.BYTES.bytereadByte()Read the byte value at the currentBuffer.readerOffset(), and increases the reader offset byByte.BYTES.charreadChar()Read the char value at the currentBuffer.readerOffset(), and increases the reader offset by 2.doublereadDouble()Read the double value at the currentBuffer.readerOffset(), and increases the reader offset byDouble.BYTES.floatreadFloat()Read the float value at the currentBuffer.readerOffset(), and increases the reader offset byFloat.BYTES.intreadInt()Read the int value at the currentBuffer.readerOffset(), and increases the reader offset byInteger.BYTES.longreadLong()Read the long value at the currentBuffer.readerOffset(), and increases the reader offset byLong.BYTES.intreadMedium()Read the int value at the currentBuffer.readerOffset(), and increases the reader offset by 3.shortreadShort()Read the short value at the currentBuffer.readerOffset(), and increases the reader offset byShort.BYTES.intreadUnsignedByte()Read the unsigned byte value at the currentBuffer.readerOffset(), and increases the reader offset byByte.BYTES.longreadUnsignedInt()Read the unsigned int value at the currentBuffer.readerOffset(), and increases the reader offset byInteger.BYTES.intreadUnsignedMedium()Read the unsigned int value at the currentBuffer.readerOffset(), and increases the reader offset by 3.intreadUnsignedShort()Read the unsigned short value at the currentBuffer.readerOffset(), and increases the reader offset byShort.BYTES.default BuffersetBoolean(int woff, boolean value)Set the given boolean value at the given write offset.BuffersetByte(int woff, byte value)Set the given byte value at the given write offset.BuffersetChar(int woff, char value)Set the given char value at the given write offset.BuffersetDouble(int woff, double value)Set the given double value at the given write offset.BuffersetFloat(int woff, float value)Set the given float value at the given write offset.BuffersetInt(int woff, int value)Set the given int value at the given write offset.BuffersetLong(int woff, long value)Set the given long value at the given write offset.BuffersetMedium(int woff, int value)Set the given int value at the given write offset.BuffersetShort(int woff, short value)Set the given short value at the given write offset.BuffersetUnsignedByte(int woff, int value)Set the given unsigned byte value at the given write offset.BuffersetUnsignedInt(int woff, long value)Set the given unsigned int value at the given write offset.BuffersetUnsignedMedium(int woff, int value)Set the given unsigned int value at the given write offset.BuffersetUnsignedShort(int woff, int value)Set the given unsigned short value at the given write offset.default BufferwriteBoolean(boolean value)Write the given boolean value at the currentBuffer.writerOffset(), and increase the writer offset byByte.BYTES.BufferwriteByte(byte value)Write the given byte value at the currentBuffer.writerOffset(), and increase the writer offset byByte.BYTES.BufferwriteChar(char value)Write the given char value at the currentBuffer.writerOffset(), and increase the writer offset by 2.BufferwriteDouble(double value)Write the given double value at the currentBuffer.writerOffset(), and increase the writer offset byDouble.BYTES.BufferwriteFloat(float value)Write the given float value at the currentBuffer.writerOffset(), and increase the writer offset byFloat.BYTES.BufferwriteInt(int value)Write the given int value at the currentBuffer.writerOffset(), and increase the writer offset byInteger.BYTES.BufferwriteLong(long value)Write the given long value at the currentBuffer.writerOffset(), and increase the writer offset byLong.BYTES.BufferwriteMedium(int value)Write the given int value at the currentBuffer.writerOffset(), and increase the writer offset by 3.BufferwriteShort(short value)Write the given short value at the currentBuffer.writerOffset(), and increase the writer offset byShort.BYTES.BufferwriteUnsignedByte(int value)Write the given unsigned byte value at the currentBuffer.writerOffset(), and increase the writer offset byByte.BYTES.BufferwriteUnsignedInt(long value)Write the given unsigned int value at the currentBuffer.writerOffset(), and increase the writer offset byInteger.BYTES.BufferwriteUnsignedMedium(int value)Write the given unsigned int value at the currentBuffer.writerOffset(), and increase the writer offset by 3.BufferwriteUnsignedShort(int value)Write the given unsigned short value at the currentBuffer.writerOffset(), and increase the writer offset byShort.BYTES.
-
-
-
Method Detail
-
readBoolean
default boolean readBoolean()
Read the boolean value at the currentBuffer.readerOffset(), and increases the reader offset byByte.BYTES. A boolean gets read as a byte from this buffer. All byte values which are not equal to zero are considered as the boolean valuetrue, zero representsfalse.- Returns:
- The boolean value at the current reader offset.
- Throws:
IndexOutOfBoundsException- IfBuffer.readableBytes()is less thanByte.BYTES.
-
getBoolean
default boolean getBoolean(int roff)
Get the boolean value at the given reader offset. TheBuffer.readerOffset()is not modified. A boolean gets read as a byte from this buffer. All byte values which are not equal to zero are considered as the boolean valuetrue, zero representsfalse.- Parameters:
roff- The read offset, an absolute offset into this buffer, to read from.- Returns:
- The boolean value at the given offset.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusByte.BYTES.
-
writeBoolean
default Buffer writeBoolean(boolean value)
Write the given boolean value at the currentBuffer.writerOffset(), and increase the writer offset byByte.BYTES. A boolean gets written as a byte to this buffer. All byte values which are not equal to zero are considered as the boolean valuetrue, zero representsfalse.- Parameters:
value- The boolean value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- IfBuffer.writableBytes()is less thanByte.BYTES, and the buffer capacity cannot be automatically increased.
-
setBoolean
default Buffer setBoolean(int woff, boolean value)
Set the given boolean value at the given write offset. TheBuffer.writerOffset()is not modified. A boolean gets written as a byte to this buffer. All byte values which are not equal to zero are considered as the boolean valuetrue, zero representsfalse.- Parameters:
woff- The write offset, an absolute offset into this buffer to write to.value- The boolean value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusByte.BYTES.
-
readByte
byte readByte()
Read the byte value at the currentBuffer.readerOffset(), and increases the reader offset byByte.BYTES. The value is read using a two's complement 8-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Returns:
- The byte value at the current reader offset.
- Throws:
IndexOutOfBoundsException- IfBuffer.readableBytes()is less thanByte.BYTES.
-
getByte
byte getByte(int roff)
Get the byte value at the given reader offset. TheBuffer.readerOffset()is not modified. The value is read using a two's complement 8-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
roff- The read offset, an absolute offset into this buffer, to read from.- Returns:
- The byte value at the given offset.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusByte.BYTES.
-
readUnsignedByte
int readUnsignedByte()
Read the unsigned byte value at the currentBuffer.readerOffset(), and increases the reader offset byByte.BYTES. The value is read using an unsigned two's complement 8-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Returns:
- The unsigned byte value at the current reader offset.
- Throws:
IndexOutOfBoundsException- IfBuffer.readableBytes()is less thanByte.BYTES.
-
getUnsignedByte
int getUnsignedByte(int roff)
Get the unsigned byte value at the given reader offset. TheBuffer.readerOffset()is not modified. The value is read using an unsigned two's complement 8-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
roff- The read offset, an absolute offset into this buffer, to read from.- Returns:
- The unsigned byte value at the given offset.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusByte.BYTES.
-
writeByte
Buffer writeByte(byte value)
Write the given byte value at the currentBuffer.writerOffset(), and increase the writer offset byByte.BYTES. The value is written using a two's complement 8-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
value- The byte value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- IfBuffer.writableBytes()is less thanByte.BYTES, and the buffer capacity cannot be automatically increased.
-
setByte
Buffer setByte(int woff, byte value)
Set the given byte value at the given write offset. TheBuffer.writerOffset()is not modified. The value is written using a two's complement 8-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
woff- The write offset, an absolute offset into this buffer to write to.value- The byte value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusByte.BYTES.
-
writeUnsignedByte
Buffer writeUnsignedByte(int value)
Write the given unsigned byte value at the currentBuffer.writerOffset(), and increase the writer offset byByte.BYTES. The value is written using an unsigned two's complement 8-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
value- The int value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- IfBuffer.writableBytes()is less thanByte.BYTES, and the buffer capacity cannot be automatically increased.
-
setUnsignedByte
Buffer setUnsignedByte(int woff, int value)
Set the given unsigned byte value at the given write offset. TheBuffer.writerOffset()is not modified. The value is written using an unsigned two's complement 8-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
woff- The write offset, an absolute offset into this buffer to write to.value- The int value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusByte.BYTES.
-
readChar
char readChar()
Read the char value at the currentBuffer.readerOffset(), and increases the reader offset by 2. The value is read using a 2-byte UTF-16 encoding, inByteOrder.BIG_ENDIANbyte order.- Returns:
- The char value at the current reader offset.
- Throws:
IndexOutOfBoundsException- IfBuffer.readableBytes()is less than 2.
-
getChar
char getChar(int roff)
Get the char value at the given reader offset. TheBuffer.readerOffset()is not modified. The value is read using a 2-byte UTF-16 encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
roff- The read offset, an absolute offset into this buffer, to read from.- Returns:
- The char value at the given offset.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minus 2.
-
writeChar
Buffer writeChar(char value)
Write the given char value at the currentBuffer.writerOffset(), and increase the writer offset by 2. The value is written using a 2-byte UTF-16 encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
value- The char value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- IfBuffer.writableBytes()is less than 2, and the buffer capacity cannot be automatically increased.
-
setChar
Buffer setChar(int woff, char value)
Set the given char value at the given write offset. TheBuffer.writerOffset()is not modified. The value is written using a 2-byte UTF-16 encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
woff- The write offset, an absolute offset into this buffer to write to.value- The char value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minus 2.
-
readShort
short readShort()
Read the short value at the currentBuffer.readerOffset(), and increases the reader offset byShort.BYTES. The value is read using a two's complement 16-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Returns:
- The short value at the current reader offset.
- Throws:
IndexOutOfBoundsException- IfBuffer.readableBytes()is less thanShort.BYTES.
-
getShort
short getShort(int roff)
Get the short value at the given reader offset. TheBuffer.readerOffset()is not modified. The value is read using a two's complement 16-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
roff- The read offset, an absolute offset into this buffer, to read from.- Returns:
- The short value at the given offset.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusShort.BYTES.
-
readUnsignedShort
int readUnsignedShort()
Read the unsigned short value at the currentBuffer.readerOffset(), and increases the reader offset byShort.BYTES. The value is read using an unsigned two's complement 16-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Returns:
- The unsigned short value at the current reader offset.
- Throws:
IndexOutOfBoundsException- IfBuffer.readableBytes()is less thanShort.BYTES.
-
getUnsignedShort
int getUnsignedShort(int roff)
Get the unsigned short value at the given reader offset. TheBuffer.readerOffset()is not modified. The value is read using an unsigned two's complement 16-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
roff- The read offset, an absolute offset into this buffer, to read from.- Returns:
- The unsigned short value at the given offset.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusShort.BYTES.
-
writeShort
Buffer writeShort(short value)
Write the given short value at the currentBuffer.writerOffset(), and increase the writer offset byShort.BYTES. The value is written using a two's complement 16-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
value- The short value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- IfBuffer.writableBytes()is less thanShort.BYTES, and the buffer capacity cannot be automatically increased.
-
setShort
Buffer setShort(int woff, short value)
Set the given short value at the given write offset. TheBuffer.writerOffset()is not modified. The value is written using a two's complement 16-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
woff- The write offset, an absolute offset into this buffer to write to.value- The short value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusShort.BYTES.
-
writeUnsignedShort
Buffer writeUnsignedShort(int value)
Write the given unsigned short value at the currentBuffer.writerOffset(), and increase the writer offset byShort.BYTES. The value is written using an unsigned two's complement 16-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
value- The int value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- IfBuffer.writableBytes()is less thanShort.BYTES, and the buffer capacity cannot be automatically increased.
-
setUnsignedShort
Buffer setUnsignedShort(int woff, int value)
Set the given unsigned short value at the given write offset. TheBuffer.writerOffset()is not modified. The value is written using an unsigned two's complement 16-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
woff- The write offset, an absolute offset into this buffer to write to.value- The int value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusShort.BYTES.
-
readMedium
int readMedium()
Read the int value at the currentBuffer.readerOffset(), and increases the reader offset by 3. The value is read using a two's complement 24-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Returns:
- The int value at the current reader offset.
- Throws:
IndexOutOfBoundsException- IfBuffer.readableBytes()is less than 3.
-
getMedium
int getMedium(int roff)
Get the int value at the given reader offset. TheBuffer.readerOffset()is not modified. The value is read using a two's complement 24-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
roff- The read offset, an absolute offset into this buffer, to read from.- Returns:
- The int value at the given offset.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minus 3.
-
readUnsignedMedium
int readUnsignedMedium()
Read the unsigned int value at the currentBuffer.readerOffset(), and increases the reader offset by 3. The value is read using an unsigned two's complement 24-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Returns:
- The unsigned int value at the current reader offset.
- Throws:
IndexOutOfBoundsException- IfBuffer.readableBytes()is less than 3.
-
getUnsignedMedium
int getUnsignedMedium(int roff)
Get the unsigned int value at the given reader offset. TheBuffer.readerOffset()is not modified. The value is read using an unsigned two's complement 24-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
roff- The read offset, an absolute offset into this buffer, to read from.- Returns:
- The unsigned int value at the given offset.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minus 3.
-
writeMedium
Buffer writeMedium(int value)
Write the given int value at the currentBuffer.writerOffset(), and increase the writer offset by 3. The value is written using a two's complement 24-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
value- The int value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- IfBuffer.writableBytes()is less than 3, and the buffer capacity cannot be automatically increased.
-
setMedium
Buffer setMedium(int woff, int value)
Set the given int value at the given write offset. TheBuffer.writerOffset()is not modified. The value is written using a two's complement 24-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
woff- The write offset, an absolute offset into this buffer to write to.value- The int value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minus 3.
-
writeUnsignedMedium
Buffer writeUnsignedMedium(int value)
Write the given unsigned int value at the currentBuffer.writerOffset(), and increase the writer offset by 3. The value is written using an unsigned two's complement 24-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
value- The int value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- IfBuffer.writableBytes()is less than 3, and the buffer capacity cannot be automatically increased.
-
setUnsignedMedium
Buffer setUnsignedMedium(int woff, int value)
Set the given unsigned int value at the given write offset. TheBuffer.writerOffset()is not modified. The value is written using an unsigned two's complement 24-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
woff- The write offset, an absolute offset into this buffer to write to.value- The int value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minus 3.
-
readInt
int readInt()
Read the int value at the currentBuffer.readerOffset(), and increases the reader offset byInteger.BYTES. The value is read using a two's complement 32-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Returns:
- The int value at the current reader offset.
- Throws:
IndexOutOfBoundsException- IfBuffer.readableBytes()is less thanInteger.BYTES.
-
getInt
int getInt(int roff)
Get the int value at the given reader offset. TheBuffer.readerOffset()is not modified. The value is read using a two's complement 32-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
roff- The read offset, an absolute offset into this buffer, to read from.- Returns:
- The int value at the given offset.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusInteger.BYTES.
-
readUnsignedInt
long readUnsignedInt()
Read the unsigned int value at the currentBuffer.readerOffset(), and increases the reader offset byInteger.BYTES. The value is read using an unsigned two's complement 32-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Returns:
- The unsigned int value at the current reader offset.
- Throws:
IndexOutOfBoundsException- IfBuffer.readableBytes()is less thanInteger.BYTES.
-
getUnsignedInt
long getUnsignedInt(int roff)
Get the unsigned int value at the given reader offset. TheBuffer.readerOffset()is not modified. The value is read using an unsigned two's complement 32-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
roff- The read offset, an absolute offset into this buffer, to read from.- Returns:
- The unsigned int value at the given offset.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusInteger.BYTES.
-
writeInt
Buffer writeInt(int value)
Write the given int value at the currentBuffer.writerOffset(), and increase the writer offset byInteger.BYTES. The value is written using a two's complement 32-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
value- The int value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- IfBuffer.writableBytes()is less thanInteger.BYTES, and the buffer capacity cannot be automatically increased.
-
setInt
Buffer setInt(int woff, int value)
Set the given int value at the given write offset. TheBuffer.writerOffset()is not modified. The value is written using a two's complement 32-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
woff- The write offset, an absolute offset into this buffer to write to.value- The int value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusInteger.BYTES.
-
writeUnsignedInt
Buffer writeUnsignedInt(long value)
Write the given unsigned int value at the currentBuffer.writerOffset(), and increase the writer offset byInteger.BYTES. The value is written using an unsigned two's complement 32-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
value- The long value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- IfBuffer.writableBytes()is less thanInteger.BYTES, and the buffer capacity cannot be automatically increased.
-
setUnsignedInt
Buffer setUnsignedInt(int woff, long value)
Set the given unsigned int value at the given write offset. TheBuffer.writerOffset()is not modified. The value is written using an unsigned two's complement 32-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
woff- The write offset, an absolute offset into this buffer to write to.value- The long value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusInteger.BYTES.
-
readFloat
float readFloat()
Read the float value at the currentBuffer.readerOffset(), and increases the reader offset byFloat.BYTES. The value is read using a 32-bit IEEE floating point encoding, inByteOrder.BIG_ENDIANbyte order.- Returns:
- The float value at the current reader offset.
- Throws:
IndexOutOfBoundsException- IfBuffer.readableBytes()is less thanFloat.BYTES.
-
getFloat
float getFloat(int roff)
Get the float value at the given reader offset. TheBuffer.readerOffset()is not modified. The value is read using a 32-bit IEEE floating point encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
roff- The read offset, an absolute offset into this buffer, to read from.- Returns:
- The float value at the given offset.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusFloat.BYTES.
-
writeFloat
Buffer writeFloat(float value)
Write the given float value at the currentBuffer.writerOffset(), and increase the writer offset byFloat.BYTES. The value is written using a 32-bit IEEE floating point encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
value- The float value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- IfBuffer.writableBytes()is less thanFloat.BYTES, and the buffer capacity cannot be automatically increased.
-
setFloat
Buffer setFloat(int woff, float value)
Set the given float value at the given write offset. TheBuffer.writerOffset()is not modified. The value is written using a 32-bit IEEE floating point encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
woff- The write offset, an absolute offset into this buffer to write to.value- The float value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusFloat.BYTES.
-
readLong
long readLong()
Read the long value at the currentBuffer.readerOffset(), and increases the reader offset byLong.BYTES. The value is read using a two's complement 64-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Returns:
- The long value at the current reader offset.
- Throws:
IndexOutOfBoundsException- IfBuffer.readableBytes()is less thanLong.BYTES.
-
getLong
long getLong(int roff)
Get the long value at the given reader offset. TheBuffer.readerOffset()is not modified. The value is read using a two's complement 64-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
roff- The read offset, an absolute offset into this buffer, to read from.- Returns:
- The long value at the given offset.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusLong.BYTES.
-
writeLong
Buffer writeLong(long value)
Write the given long value at the currentBuffer.writerOffset(), and increase the writer offset byLong.BYTES. The value is written using a two's complement 64-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
value- The long value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- IfBuffer.writableBytes()is less thanLong.BYTES, and the buffer capacity cannot be automatically increased.
-
setLong
Buffer setLong(int woff, long value)
Set the given long value at the given write offset. TheBuffer.writerOffset()is not modified. The value is written using a two's complement 64-bit encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
woff- The write offset, an absolute offset into this buffer to write to.value- The long value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusLong.BYTES.
-
readDouble
double readDouble()
Read the double value at the currentBuffer.readerOffset(), and increases the reader offset byDouble.BYTES. The value is read using a 64-bit IEEE floating point encoding, inByteOrder.BIG_ENDIANbyte order.- Returns:
- The double value at the current reader offset.
- Throws:
IndexOutOfBoundsException- IfBuffer.readableBytes()is less thanDouble.BYTES.
-
getDouble
double getDouble(int roff)
Get the double value at the given reader offset. TheBuffer.readerOffset()is not modified. The value is read using a 64-bit IEEE floating point encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
roff- The read offset, an absolute offset into this buffer, to read from.- Returns:
- The double value at the given offset.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusDouble.BYTES.
-
writeDouble
Buffer writeDouble(double value)
Write the given double value at the currentBuffer.writerOffset(), and increase the writer offset byDouble.BYTES. The value is written using a 64-bit IEEE floating point encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
value- The double value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- IfBuffer.writableBytes()is less thanDouble.BYTES, and the buffer capacity cannot be automatically increased.
-
setDouble
Buffer setDouble(int woff, double value)
Set the given double value at the given write offset. TheBuffer.writerOffset()is not modified. The value is written using a 64-bit IEEE floating point encoding, inByteOrder.BIG_ENDIANbyte order.- Parameters:
woff- The write offset, an absolute offset into this buffer to write to.value- The double value to write.- Returns:
- This Buffer.
- Throws:
IndexOutOfBoundsException- if the given offset is out of bounds of the buffer, that is, less than 0 or greater thanBuffer.capacity()minusDouble.BYTES.
-
-