This class defines six categories of operations upon byte buffers:. More...
#include <src/main/decaf/internal/nio/ByteArrayBuffer.h>

Public Member Functions | |||||||||||||
| ByteArrayBuffer (int capacity, bool readOnly=false) | |||||||||||||
| Creates a ByteArrayBuffer object that has its backing array allocated internally and is then owned and deleted when this object is deleted. | |||||||||||||
| ByteArrayBuffer (unsigned char *array, int size, int offset, int length, bool readOnly=false) | |||||||||||||
| Creates a ByteArrayBuffer object that wraps the given array. | |||||||||||||
| ByteArrayBuffer (const decaf::lang::Pointer< ByteArrayAdapter > &array, int offset, int length, bool readOnly=false) | |||||||||||||
| Creates a byte buffer that wraps the passed ByteArrayAdapter and start at the given offset. | |||||||||||||
| ByteArrayBuffer (const ByteArrayBuffer &other) | |||||||||||||
| Create a ByteArrayBuffer that mirrors this one, meaning it shares a reference to this buffers ByteArrayAdapter and when changes are made to that data it is reflected in both. | |||||||||||||
| virtual | ~ByteArrayBuffer () | ||||||||||||
| virtual bool | isReadOnly () const | ||||||||||||
Tells whether or not this buffer is read-only.
| |||||||||||||
| virtual unsigned char * | array () | ||||||||||||
Returns the byte array that backs this buffer.Modifications to this buffer's content will cause the returned array's content to be modified, and vice versa.Invoke the hasArray method before invoking this method in order to ensure that this buffer has an accessible backing array.
| |||||||||||||
| virtual int | arrayOffset () const | ||||||||||||
Returns the offset within this buffer's backing array of the first element of the buffer.If this buffer is backed by an array then buffer position p corresponds to array index p + arrayOffset().Invoke the hasArray method before invoking this method in order to ensure that this buffer has an accessible backing array.
| |||||||||||||
| virtual bool | hasArray () const | ||||||||||||
Tells whether or not this buffer is backed by an accessible byte array.If this method returns true then the array and arrayOffset methods may safely be invoked. Subclasses should override this method if they do not have a backing array as this class always returns true.
| |||||||||||||
| virtual decaf::nio::CharBuffer * | asCharBuffer () const | ||||||||||||
Creates a view of this byte buffer as a char buffer.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
| |||||||||||||
| virtual decaf::nio::DoubleBuffer * | asDoubleBuffer () const | ||||||||||||
Creates a view of this byte buffer as a double buffer.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by eight, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
| |||||||||||||
| virtual decaf::nio::FloatBuffer * | asFloatBuffer () const | ||||||||||||
Creates a view of this byte buffer as a float buffer.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by four, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
| |||||||||||||
| virtual decaf::nio::IntBuffer * | asIntBuffer () const | ||||||||||||
Creates a view of this byte buffer as a int buffer.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by four, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
| |||||||||||||
| virtual decaf::nio::LongBuffer * | asLongBuffer () const | ||||||||||||
Creates a view of this byte buffer as a long buffer.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by eight, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
| |||||||||||||
| virtual decaf::nio::ShortBuffer * | asShortBuffer () const | ||||||||||||
Creates a view of this byte buffer as a short buffer.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by two, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
| |||||||||||||
| virtual ByteArrayBuffer * | asReadOnlyBuffer () const | ||||||||||||
Creates a new, read-only byte buffer that shares this buffer's content.The content of the new buffer will be that of this buffer. Changes to this buffer's content will be visible in the new buffer; the new buffer itself, however, will be read-only and will not allow the shared content to be modified. The two buffers' position, limit, and mark values will be independent.If this buffer is itself read-only then this method behaves in exactly the same way as the duplicate method.The new buffer's capacity, limit, position, and mark values will be identical to those of this buffer.
| |||||||||||||
| virtual ByteArrayBuffer & | compact () | ||||||||||||
Compacts this buffer.The bytes between the buffer's current position and its limit, if any, are copied to the beginning of the buffer. That is, the byte at index p = position() is copied to index zero, the byte at index p + 1 is copied to index one, and so forth until the byte at index limit() - 1 is copied to index n = limit() - 1 - p. The buffer's position is then set to n+1 and its limit is set to its capacity. The mark, if defined, is discarded.The buffer's position is set to the number of bytes copied, rather than to zero, so that an invocation of this method can be followed immediately by an invocation of another relative put method.
| |||||||||||||
| virtual ByteArrayBuffer * | duplicate () | ||||||||||||
Creates a new byte buffer that shares this buffer's content.The content of the new buffer will be that of this buffer. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's capacity, limit, position, and mark values will be identical to those of this buffer. The new buffer will be read-only if, and only if, this buffer is read-only.
| |||||||||||||
| virtual unsigned char | get () const | ||||||||||||
Relative get method.Reads the byte at this buffer's current position, and then increments the position.
| |||||||||||||
| virtual unsigned char | get (int index) const | ||||||||||||
Absolute get method.Reads the byte at the given index.
| |||||||||||||
| virtual char | getChar () | ||||||||||||
Reads the next byte at this buffer's current position, and then increments the position by one.
| |||||||||||||
| virtual char | getChar (int index) const | ||||||||||||
Reads one byte at the given index and returns it.
| |||||||||||||
| virtual double | getDouble () | ||||||||||||
Reads the next eight bytes at this buffer's current position, and then increments the position by that amount.
| |||||||||||||
| virtual double | getDouble (int index) const | ||||||||||||
Reads eight bytes at the given index and returns it.
| |||||||||||||
| virtual float | getFloat () | ||||||||||||
Reads the next four bytes at this buffer's current position, and then increments the position by that amount.
| |||||||||||||
| virtual float | getFloat (int index) const | ||||||||||||
Reads four bytes at the given index and returns it.
| |||||||||||||
| virtual long long | getLong () | ||||||||||||
Reads the next eight bytes at this buffer's current position, and then increments the position by that amount.
| |||||||||||||
| virtual long long | getLong (int index) const | ||||||||||||
Reads eight bytes at the given index and returns it.
| |||||||||||||
| virtual int | getInt () | ||||||||||||
Reads the next four bytes at this buffer's current position, and then increments the position by that amount.
| |||||||||||||
| virtual int | getInt (int index) const | ||||||||||||
Reads four bytes at the given index and returns it.
| |||||||||||||
| virtual short | getShort () | ||||||||||||
Reads the next two bytes at this buffer's current position, and then increments the position by that amount.
| |||||||||||||
| virtual short | getShort (int index) const | ||||||||||||
Reads two bytes at the given index and returns it.
| |||||||||||||
| virtual ByteArrayBuffer & | put (unsigned char value) | ||||||||||||
Writes the given byte into this buffer at the current position, and then increments the position.
| |||||||||||||
| virtual ByteArrayBuffer & | put (int index, unsigned char value) | ||||||||||||
Writes the given byte into this buffer at the given index.
| |||||||||||||
| virtual ByteArrayBuffer & | putChar (char value) | ||||||||||||
Writes one byte containing the given value, into this buffer at the current position, and then increments the position by one.
| |||||||||||||
| virtual ByteArrayBuffer & | putChar (int index, char value) | ||||||||||||
Writes one byte containing the given value, into this buffer at the given index.
| |||||||||||||
| virtual ByteArrayBuffer & | putDouble (double value) | ||||||||||||
Writes eight bytes containing the given value, into this buffer at the current position, and then increments the position by eight.
| |||||||||||||
| virtual ByteArrayBuffer & | putDouble (int index, double value) | ||||||||||||
Writes eight bytes containing the given value, into this buffer at the given index.
| |||||||||||||
| virtual ByteArrayBuffer & | putFloat (float value) | ||||||||||||
Writes four bytes containing the given value, into this buffer at the current position, and then increments the position by eight.
| |||||||||||||
| virtual ByteArrayBuffer & | putFloat (int index, float value) | ||||||||||||
Writes four bytes containing the given value, into this buffer at the given index.
| |||||||||||||
| virtual ByteArrayBuffer & | putLong (long long value) | ||||||||||||
Writes eight bytes containing the given value, into this buffer at the current position, and then increments the position by eight.
| |||||||||||||
| virtual ByteArrayBuffer & | putLong (int index, long long value) | ||||||||||||
Writes eight bytes containing the given value, into this buffer at the given index.
| |||||||||||||
| virtual ByteArrayBuffer & | putInt (int value) | ||||||||||||
Writes four bytes containing the given value, into this buffer at the current position, and then increments the position by eight.
| |||||||||||||
| virtual ByteArrayBuffer & | putInt (int index, int value) | ||||||||||||
Writes four bytes containing the given value, into this buffer at the given index.
| |||||||||||||
| virtual ByteArrayBuffer & | putShort (short value) | ||||||||||||
Writes two bytes containing the given value, into this buffer at the current position, and then increments the position by eight.
| |||||||||||||
| virtual ByteArrayBuffer & | putShort (int index, short value) | ||||||||||||
Writes two bytes containing the given value, into this buffer at the given index.
| |||||||||||||
| virtual ByteArrayBuffer * | slice () const | ||||||||||||
Creates a new byte buffer whose content is a shared subsequence of this buffer's content.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
| |||||||||||||
Protected Member Functions | |||||||||||||
| virtual void | setReadOnly (bool value) | ||||||||||||
| Sets this ByteArrayBuffer as Read-Only or not Read-Only. | |||||||||||||
This class defines six categories of operations upon byte buffers:.
1. Absolute and relative get and put methods that read and write single bytes; 2. Relative bulk get methods that transfer contiguous sequences of bytes from this buffer into an array; 3. Relative bulk put methods that transfer contiguous sequences of bytes from a byte array or some other byte buffer into this buffer; 4. Absolute and relative get and put methods that read and write values of other primitive types, translating them to and from sequences of bytes in a particular byte order; 5. Methods for creating view buffers, which allow a byte buffer to be viewed as a buffer containing values of some other primitive type; and 6. Methods for compacting, duplicating, and slicing a byte buffer.
Byte buffers can be created either by allocation, which allocates space for the buffer's content, or by wrapping an existing byte array into a buffer.
Access to binary data:
This class defines methods for reading and writing values of all other primitive types, except boolean. Primitive values are translated to (or from) sequences of bytes according to the buffer's current byte order.
For access to heterogeneous binary data, that is, sequences of values of different types, this class defines a family of absolute and relative get and put methods for each type. For 32-bit floating-point values, for example, this class defines:
float getFloat() float getFloat(int index) void putFloat(float f) void putFloat(int index, float f)
Corresponding methods are defined for the types char, short, int, long, and double. The index parameters of the absolute get and put methods are in terms of bytes rather than of the type being read or written.
For access to homogeneous binary data, that is, sequences of values of the same type, this class defines methods that can create views of a given byte buffer. A view buffer is simply another buffer whose content is backed by the byte buffer. Changes to the byte buffer's content will be visible in the view buffer, and vice versa; the two buffers' position, limit, and mark values are independent. The asFloatBuffer method, for example, creates an instance of the FloatBuffer class that is backed by the byte buffer upon which the method is invoked. Corresponding view-creation methods are defined for the types char, short, int, long, and double.
View buffers have two important advantages over the families of type-specific get and put methods described above:
A view buffer is indexed not in terms of bytes but rather in terms of the type-specific size of its values;
A view buffer provides relative bulk get and put methods that can transfer contiguous sequences of values between a buffer and an array or some other buffer of the same type; and
| decaf::internal::nio::ByteArrayBuffer::ByteArrayBuffer | ( | int | capacity, | |
| bool | readOnly = false | |||
| ) |
Creates a ByteArrayBuffer object that has its backing array allocated internally and is then owned and deleted when this object is deleted.
The array is initially created with all elements initialized to zero.
| capacity | The size of the array, this is the limit we read and write to. | |
| readOnly | Should this buffer be read-only, default as false |
| IllegalArguementException | if the capacity value is negative. |
| decaf::internal::nio::ByteArrayBuffer::ByteArrayBuffer | ( | unsigned char * | array, | |
| int | size, | |||
| int | offset, | |||
| int | length, | |||
| bool | readOnly = false | |||
| ) |
Creates a ByteArrayBuffer object that wraps the given array.
| array | The array to wrap. | |
| size | The size of the array passed. | |
| offset | The position that is this buffers start position. | |
| length | The size of the sub-array, this is the limit we read and write to. | |
| readOnly | Should this buffer be read-only, default as false. |
| NullPointerException | if buffer is NULL | |
| IndexOutOfBoundsException | if the preconditions of size, offset and length are violated. |
| decaf::internal::nio::ByteArrayBuffer::ByteArrayBuffer | ( | const decaf::lang::Pointer< ByteArrayAdapter > & | array, | |
| int | offset, | |||
| int | length, | |||
| bool | readOnly = false | |||
| ) |
Creates a byte buffer that wraps the passed ByteArrayAdapter and start at the given offset.
The capacity and limit of the new ByteArrayBuffer will be that of the remaining capacity of the passed buffer.
| array | The ByteArrayAdapter to wrap | |
| offset | The offset into array where the buffer starts | |
| length | The length of the array we are wrapping or limit. | |
| readOnly | Boolean indicating if this a readOnly buffer. |
| NullPointerException | if array is NULL | |
| IndexOutOfBoundsException | if offset is greater than array capacity. |
| decaf::internal::nio::ByteArrayBuffer::ByteArrayBuffer | ( | const ByteArrayBuffer & | other | ) |
Create a ByteArrayBuffer that mirrors this one, meaning it shares a reference to this buffers ByteArrayAdapter and when changes are made to that data it is reflected in both.
| other | The ByteArrayBuffer this one is to mirror. |
| virtual decaf::internal::nio::ByteArrayBuffer::~ByteArrayBuffer | ( | ) | [virtual] |
| virtual unsigned char* decaf::internal::nio::ByteArrayBuffer::array | ( | ) | [virtual] |
Returns the byte array that backs this buffer.Modifications to this buffer's content will cause the returned array's content to be modified, and vice versa.Invoke the hasArray method before invoking this method in order to ensure that this buffer has an accessible backing array.
| ReadOnlyBufferException | if this buffer is backed by an array but is read-only | |
| UnsupportedOperationException | if this buffer is not backed by an accessible array |
Implements decaf::nio::ByteBuffer.
| virtual int decaf::internal::nio::ByteArrayBuffer::arrayOffset | ( | ) | const [virtual] |
Returns the offset within this buffer's backing array of the first element of the buffer.If this buffer is backed by an array then buffer position p corresponds to array index p + arrayOffset().Invoke the hasArray method before invoking this method in order to ensure that this buffer has an accessible backing array.
| ReadOnlyBufferException | if this buffer is backed by an array but is read-only. | |
| UnsupportedOperationException | if this buffer is not backed by an accessible array. |
Implements decaf::nio::ByteBuffer.
| virtual decaf::nio::CharBuffer* decaf::internal::nio::ByteArrayBuffer::asCharBuffer | ( | ) | const [inline, virtual] |
Creates a view of this byte buffer as a char buffer.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
Implements decaf::nio::ByteBuffer.
References NULL.
| virtual decaf::nio::DoubleBuffer* decaf::internal::nio::ByteArrayBuffer::asDoubleBuffer | ( | ) | const [inline, virtual] |
Creates a view of this byte buffer as a double buffer.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by eight, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
Implements decaf::nio::ByteBuffer.
References NULL.
| virtual decaf::nio::FloatBuffer* decaf::internal::nio::ByteArrayBuffer::asFloatBuffer | ( | ) | const [inline, virtual] |
Creates a view of this byte buffer as a float buffer.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by four, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
Implements decaf::nio::ByteBuffer.
References NULL.
| virtual decaf::nio::IntBuffer* decaf::internal::nio::ByteArrayBuffer::asIntBuffer | ( | ) | const [inline, virtual] |
Creates a view of this byte buffer as a int buffer.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by four, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
Implements decaf::nio::ByteBuffer.
References NULL.
| virtual decaf::nio::LongBuffer* decaf::internal::nio::ByteArrayBuffer::asLongBuffer | ( | ) | const [inline, virtual] |
Creates a view of this byte buffer as a long buffer.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by eight, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
Implements decaf::nio::ByteBuffer.
References NULL.
| virtual ByteArrayBuffer* decaf::internal::nio::ByteArrayBuffer::asReadOnlyBuffer | ( | ) | const [virtual] |
Creates a new, read-only byte buffer that shares this buffer's content.The content of the new buffer will be that of this buffer. Changes to this buffer's content will be visible in the new buffer; the new buffer itself, however, will be read-only and will not allow the shared content to be modified. The two buffers' position, limit, and mark values will be independent.If this buffer is itself read-only then this method behaves in exactly the same way as the duplicate method.The new buffer's capacity, limit, position, and mark values will be identical to those of this buffer.
Implements decaf::nio::ByteBuffer.
| virtual decaf::nio::ShortBuffer* decaf::internal::nio::ByteArrayBuffer::asShortBuffer | ( | ) | const [inline, virtual] |
Creates a view of this byte buffer as a short buffer.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by two, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
Implements decaf::nio::ByteBuffer.
References NULL.
| virtual ByteArrayBuffer& decaf::internal::nio::ByteArrayBuffer::compact | ( | ) | [virtual] |
Compacts this buffer.The bytes between the buffer's current position and its limit, if any, are copied to the beginning of the buffer. That is, the byte at index p = position() is copied to index zero, the byte at index p + 1 is copied to index one, and so forth until the byte at index limit() - 1 is copied to index n = limit() - 1 - p. The buffer's position is then set to n+1 and its limit is set to its capacity. The mark, if defined, is discarded.The buffer's position is set to the number of bytes copied, rather than to zero, so that an invocation of this method can be followed immediately by an invocation of another relative put method.
| ReadOnlyBufferException | if this buffer is read-only. |
Implements decaf::nio::ByteBuffer.
| virtual ByteArrayBuffer* decaf::internal::nio::ByteArrayBuffer::duplicate | ( | ) | [virtual] |
Creates a new byte buffer that shares this buffer's content.The content of the new buffer will be that of this buffer. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's capacity, limit, position, and mark values will be identical to those of this buffer. The new buffer will be read-only if, and only if, this buffer is read-only.
Implements decaf::nio::ByteBuffer.
| virtual unsigned char decaf::internal::nio::ByteArrayBuffer::get | ( | int | index | ) | const [virtual] |
Absolute get method.Reads the byte at the given index.
| index | The index in the Buffer where the byte is to be read. |
| IndexOutOfBoundsException | if index is not smaller than the buffer's limit, or index is negative. |
Implements decaf::nio::ByteBuffer.
| virtual unsigned char decaf::internal::nio::ByteArrayBuffer::get | ( | ) | const [virtual] |
Relative get method.Reads the byte at this buffer's current position, and then increments the position.
| BufferUnderflowException | if the buffer's current position is not smaller than its limit. |
Implements decaf::nio::ByteBuffer.
| virtual char decaf::internal::nio::ByteArrayBuffer::getChar | ( | int | index | ) | const [inline, virtual] |
Reads one byte at the given index and returns it.
| index | The index in the Buffer where the byte is to be read. |
| IndexOutOfBoundsException | if index is not smaller than the buffer's limit, or index is negative. |
Implements decaf::nio::ByteBuffer.
| virtual char decaf::internal::nio::ByteArrayBuffer::getChar | ( | ) | [inline, virtual] |
Reads the next byte at this buffer's current position, and then increments the position by one.
| BufferUnderflowException | if there are no more bytes remaining in this buffer, meaning we have reached the set limit. |
Implements decaf::nio::ByteBuffer.
| virtual double decaf::internal::nio::ByteArrayBuffer::getDouble | ( | int | index | ) | const [virtual] |
Reads eight bytes at the given index and returns it.
| index | The index in the Buffer where the bytes are to be read. |
| IndexOutOfBoundsException | if index is not smaller than the buffer's limit, or index is negative. |
Implements decaf::nio::ByteBuffer.
| virtual double decaf::internal::nio::ByteArrayBuffer::getDouble | ( | ) | [virtual] |
Reads the next eight bytes at this buffer's current position, and then increments the position by that amount.
| BufferUnderflowException | if there are no more bytes remaining in this buffer, meaning we have reached the set limit. |
Implements decaf::nio::ByteBuffer.
| virtual float decaf::internal::nio::ByteArrayBuffer::getFloat | ( | int | index | ) | const [virtual] |
Reads four bytes at the given index and returns it.
| index | The index in the Buffer where the bytes are to be read. |
| IndexOutOfBoundsException | if there are not enough bytes remaining to fill the requested Data Type, or index is negative. |
Implements decaf::nio::ByteBuffer.
| virtual float decaf::internal::nio::ByteArrayBuffer::getFloat | ( | ) | [virtual] |
Reads the next four bytes at this buffer's current position, and then increments the position by that amount.
| BufferUnderflowException | if there are no more bytes remaining in this buffer, meaning we have reached the set limit. |
Implements decaf::nio::ByteBuffer.
| virtual int decaf::internal::nio::ByteArrayBuffer::getInt | ( | int | index | ) | const [virtual] |
Reads four bytes at the given index and returns it.
| index | The index in the Buffer where the bytes are to be read. |
| IndexOutOfBoundsException | if there are not enough bytes remaining to fill the requested Data Type, or index is negative. |
Implements decaf::nio::ByteBuffer.
| virtual int decaf::internal::nio::ByteArrayBuffer::getInt | ( | ) | [virtual] |
Reads the next four bytes at this buffer's current position, and then increments the position by that amount.
| BufferUnderflowException | if there are no more bytes remaining in this buffer, meaning we have reached the set limit. |
Implements decaf::nio::ByteBuffer.
| virtual long long decaf::internal::nio::ByteArrayBuffer::getLong | ( | int | index | ) | const [virtual] |
Reads eight bytes at the given index and returns it.
| index | The index in the Buffer where the bytes are to be read. |
| IndexOutOfBoundsException | if there are not enough bytes remaining to fill the requested Data Type, or index is negative. |
Implements decaf::nio::ByteBuffer.
| virtual long long decaf::internal::nio::ByteArrayBuffer::getLong | ( | ) | [virtual] |
Reads the next eight bytes at this buffer's current position, and then increments the position by that amount.
| BufferUnderflowException | if there are no more bytes remaining in this buffer, meaning we have reached the set limit. |
Implements decaf::nio::ByteBuffer.
| virtual short decaf::internal::nio::ByteArrayBuffer::getShort | ( | int | index | ) | const [virtual] |
Reads two bytes at the given index and returns it.
| index | The index in the Buffer where the bytes are to be read. |
| IndexOutOfBoundsException | if there are not enough bytes remaining to fill the requested Data Type, or index is negative. |
Implements decaf::nio::ByteBuffer.
| virtual short decaf::internal::nio::ByteArrayBuffer::getShort | ( | ) | [virtual] |
Reads the next two bytes at this buffer's current position, and then increments the position by that amount.
| BufferUnderflowException | if there are no more bytes remaining in this buffer, meaning we have reached the set limit. |
Implements decaf::nio::ByteBuffer.
| virtual bool decaf::internal::nio::ByteArrayBuffer::hasArray | ( | ) | const [inline, virtual] |
Tells whether or not this buffer is backed by an accessible byte array.If this method returns true then the array and arrayOffset methods may safely be invoked. Subclasses should override this method if they do not have a backing array as this class always returns true.
Implements decaf::nio::ByteBuffer.
| virtual bool decaf::internal::nio::ByteArrayBuffer::isReadOnly | ( | ) | const [inline, virtual] |
Tells whether or not this buffer is read-only.
Implements decaf::nio::ByteBuffer.
| virtual ByteArrayBuffer& decaf::internal::nio::ByteArrayBuffer::put | ( | int | index, | |
| unsigned char | value | |||
| ) | [virtual] |
Writes the given byte into this buffer at the given index.
| index | - position in the Buffer to write the data | |
| value | - the byte to write. |
| IndexOutOfBoundsException | if index greater than the buffer's limit minus the size of the type being written, or index is negative. | |
| ReadOnlyBufferException | if this buffer is read-only. |
Implements decaf::nio::ByteBuffer.
| virtual ByteArrayBuffer& decaf::internal::nio::ByteArrayBuffer::put | ( | unsigned char | value | ) | [virtual] |
Writes the given byte into this buffer at the current position, and then increments the position.
| value | - the byte value to be written. |
| BufferOverflowException | if this buffer's current position is not smaller than its limit. | |
| ReadOnlyBufferException | if this buffer is read-only. |
Implements decaf::nio::ByteBuffer.
| virtual ByteArrayBuffer& decaf::internal::nio::ByteArrayBuffer::putChar | ( | int | index, | |
| char | value | |||
| ) | [virtual] |
Writes one byte containing the given value, into this buffer at the given index.
| index | The position in the Buffer to write the data. | |
| value | The value to write. |
| IndexOutOfBoundsException | if index greater than the buffer's limit minus the size of the type being written, or index is negative. | |
| ReadOnlyBufferException | if this buffer is read-only |
Implements decaf::nio::ByteBuffer.
| virtual ByteArrayBuffer& decaf::internal::nio::ByteArrayBuffer::putChar | ( | char | value | ) | [virtual] |
Writes one byte containing the given value, into this buffer at the current position, and then increments the position by one.
| value | The value to be written. |
| BufferOverflowException | if there are fewer than bytes remaining in this buffer than the size of the data to be written | |
| ReadOnlyBufferException | if this buffer is read-only |
Implements decaf::nio::ByteBuffer.
| virtual ByteArrayBuffer& decaf::internal::nio::ByteArrayBuffer::putDouble | ( | int | index, | |
| double | value | |||
| ) | [virtual] |
Writes eight bytes containing the given value, into this buffer at the given index.
| index | The position in the Buffer to write the data | |
| value | The value to write. |
| IndexOutOfBoundsException | if index greater than the buffer's limit minus the size of the type being written, or index is negative. | |
| ReadOnlyBufferException | if this buffer is read-only. |
Implements decaf::nio::ByteBuffer.
| virtual ByteArrayBuffer& decaf::internal::nio::ByteArrayBuffer::putDouble | ( | double | value | ) | [virtual] |
Writes eight bytes containing the given value, into this buffer at the current position, and then increments the position by eight.
| value | The value to be written. |
| BufferOverflowException | if there are fewer than bytes remaining in this buffer than the size of the data to be written | |
| ReadOnlyBufferException | if this buffer is read-only |
Implements decaf::nio::ByteBuffer.
| virtual ByteArrayBuffer& decaf::internal::nio::ByteArrayBuffer::putFloat | ( | int | index, | |
| float | value | |||
| ) | [virtual] |
Writes four bytes containing the given value, into this buffer at the given index.
| index | The position in the Buffer to write the data | |
| value | The value to write. |
| IndexOutOfBoundsException | if index greater than the buffer's limit minus the size of the type being written, or index is negative. | |
| ReadOnlyBufferException | if this buffer is read-only. |
Implements decaf::nio::ByteBuffer.
| virtual ByteArrayBuffer& decaf::internal::nio::ByteArrayBuffer::putFloat | ( | float | value | ) | [virtual] |
Writes four bytes containing the given value, into this buffer at the current position, and then increments the position by eight.
| value | The value to be written. |
| BufferOverflowException | if there are fewer than bytes remaining in this buffer than the size of the data to be written. | |
| ReadOnlyBufferException | if this buffer is read-only. |
Implements decaf::nio::ByteBuffer.
| virtual ByteArrayBuffer& decaf::internal::nio::ByteArrayBuffer::putInt | ( | int | index, | |
| int | value | |||
| ) | [virtual] |
Writes four bytes containing the given value, into this buffer at the given index.
| index | The position in the Buffer to write the data. | |
| value | The value to write. |
| IndexOutOfBoundsException | if index greater than the buffer's limit minus the size of the type being written, or index is negative. | |
| ReadOnlyBufferException | if this buffer is read-only |
Implements decaf::nio::ByteBuffer.
| virtual ByteArrayBuffer& decaf::internal::nio::ByteArrayBuffer::putInt | ( | int | value | ) | [virtual] |
Writes four bytes containing the given value, into this buffer at the current position, and then increments the position by eight.
| value | The value to be written. |
| BufferOverflowException | if there are fewer than bytes remaining in this buffer than the size of the data to be written | |
| ReadOnlyBufferException | if this buffer is read-only |
Implements decaf::nio::ByteBuffer.
| virtual ByteArrayBuffer& decaf::internal::nio::ByteArrayBuffer::putLong | ( | int | index, | |
| long long | value | |||
| ) | [virtual] |
Writes eight bytes containing the given value, into this buffer at the given index.
| index | The position in the Buffer to write the data. | |
| value | The value to write. |
| IndexOutOfBoundsException | if index greater than the buffer's limit minus the size of the type being written, or index is negative. | |
| ReadOnlyBufferException | if this buffer is read-only. |
Implements decaf::nio::ByteBuffer.
| virtual ByteArrayBuffer& decaf::internal::nio::ByteArrayBuffer::putLong | ( | long long | value | ) | [virtual] |
Writes eight bytes containing the given value, into this buffer at the current position, and then increments the position by eight.
| value | The value to be written. |
| BufferOverflowException | if there are fewer than bytes remaining in this buffer than the size of the data to be written. | |
| ReadOnlyBufferException | if this buffer is read-only. |
Implements decaf::nio::ByteBuffer.
| virtual ByteArrayBuffer& decaf::internal::nio::ByteArrayBuffer::putShort | ( | int | index, | |
| short | value | |||
| ) | [virtual] |
Writes two bytes containing the given value, into this buffer at the given index.
| index | The position in the Buffer to write the data | |
| value | The value to write. |
| IndexOutOfBoundsException | if index greater than the buffer's limit minus the size of the type being written, or index is negative. | |
| ReadOnlyBufferException | if this buffer is read-only. |
Implements decaf::nio::ByteBuffer.
| virtual ByteArrayBuffer& decaf::internal::nio::ByteArrayBuffer::putShort | ( | short | value | ) | [virtual] |
Writes two bytes containing the given value, into this buffer at the current position, and then increments the position by eight.
| value | The value to be written. |
| BufferOverflowException | if there are fewer than bytes remaining in this buffer than the size of the data to be written. | |
| ReadOnlyBufferException | if this buffer is read-only. |
Implements decaf::nio::ByteBuffer.
| virtual void decaf::internal::nio::ByteArrayBuffer::setReadOnly | ( | bool | value | ) | [inline, protected, virtual] |
Sets this ByteArrayBuffer as Read-Only or not Read-Only.
| value | Boolean value, true if this buffer is to be read-only, false otherwise. |
| virtual ByteArrayBuffer* decaf::internal::nio::ByteArrayBuffer::slice | ( | ) | const [virtual] |
Creates a new byte buffer whose content is a shared subsequence of this buffer's content.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
Implements decaf::nio::ByteBuffer.
1.6.1