Logo Search packages:      
Sourcecode: cacao-oj6 version File versions

LongBuffer java::nio::LongBuffer::put ( long[]  src,
int  offset,
int  length 
) [inline]

Relative bulk put method  (optional operation).

This method transfers longs into this buffer from the given source array. If there are more longs to be copied from the array than remain in this buffer, that is, if length > remaining(), then no longs are transferred and a BufferOverflowException is thrown.

Otherwise, this method copies length longs from the given array into this buffer, starting at the given offset in the array and at the current position of this buffer. The position of this buffer is then incremented by length.

In other words, an invocation of this method of the form dst.put(src, off, len) has exactly the same effect as the loop

     for (int i = off; i < off + len; i++)

except that it first checks that there is sufficient space in this buffer and it is potentially much more efficient.

src The array from which longs are to be read
offset The offset within the array of the first long to be read; must be non-negative and no larger than array.length
length The number of longs to be read from the given array; must be non-negative and no larger than array.length - offset
This buffer
BufferOverflowException If there is insufficient space in this buffer
IndexOutOfBoundsException If the preconditions on the offset and length parameters do not hold
ReadOnlyBufferException If this buffer is read-only

Reimplemented in java::nio::HeapLongBuffer, and java::nio::HeapLongBufferR.

Definition at line 800 of file LongBuffer.java.

References put().

        checkBounds(offset, length, src.length);
        if (length > remaining())
            throw new BufferOverflowException();
        int end = offset + length;
        for (int i = offset; i < end; i++)
        return this;

Generated by  Doxygen 1.6.0   Back to index