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

abstract LongBuffer java::nio::LongBuffer::compact (  )  [pure virtual]

Compacts this buffer  (optional operation).

The longs between the buffer's current position and its limit, if any, are copied to the beginning of the buffer. That is, the long at index p = position() is copied to index zero, the long at index p + 1 is copied to index one, and so forth until the long 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 longs copied, rather than to zero, so that an invocation of this method can be followed immediately by an invocation of another relative put method.

This buffer
ReadOnlyBufferException If this buffer is read-only

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

Generated by  Doxygen 1.6.0   Back to index