Relative bulk put method (optional operation).
This method transfers the ints remaining in the given source
buffer into this buffer. If there are more ints remaining in the
source buffer than in this buffer, that is, if
src.remaining() > remaining(),
then no ints are transferred and a BufferOverflowException is thrown.
Otherwise, this method copies n = src.remaining() ints from the given buffer into this buffer, starting at each buffer's current position. The positions of both buffers are then incremented by n.
In other words, an invocation of this method of the form dst.put(src) has exactly the same effect as the loop
while (src.hasRemaining())
dst.put(src.get());
except that it first checks that there is sufficient space in this
buffer and it is potentially much more efficient.
src
| The source buffer from which ints are to be read; must not be this buffer |
BufferOverflowException
| If there is insufficient space in this buffer for the remaining ints in the source buffer | |
IllegalArgumentException
| If the source buffer is this buffer | |
ReadOnlyBufferException
| If this buffer is read-only |
Diagram: Buffer