Relative bulk get method.
This method transfers longs from this buffer into the given destination array. If there are fewer longs remaining in the buffer than are required to satisfy the request, that is, if
remaining(), then no longs are transferred and a BufferUnderflowException is thrown.
Otherwise, this method copies
length longs from this buffer into the given array, starting at the current position of this buffer and at the given offset in the array. The position of this buffer is then incremented by
In other words, an invocation of this method of the form
src.get(dst, off, len) has exactly the same effect as the loop
for (int i = off; i < off + len; i++)
dst[i] = src.get();
except that it first checks that there are sufficient longs in this buffer and it is potentially much more efficient.
|dst ||The array into which longs are to be written|
|offset ||The offset within the array of the first long to be written; must be non-negative and no larger than |
|length ||The maximum number of longs to be written to the given array; must be non-negative and no larger than |
dst.length - offset
- This buffer
|BufferUnderflowException ||If there are fewer than |
length longs remaining in this buffer
|IndexOutOfBoundsException ||If the preconditions on the |
length parameters do not hold
Reimplemented in java::nio::HeapLongBuffer.
Definition at line 665 of file LongBuffer.java.
checkBounds(offset, length, dst.length);
if (length > remaining())
throw new BufferUnderflowException();
int end = offset + length;
for (int i = offset; i < end; i++)
dst[i] = get();