LongBuffer

public abstract class LongBuffer extends Buffer
implements Comparable<LongBuffer>

A long buffer.

This class defines four categories of operations upon long buffers:

  • Absolute and relative get and put methods that read and write single longs;

  • Relative bulk get methods that transfer contiguous sequences of longs from this buffer into an array; and

  • Relative bulk put methods that transfer contiguous sequences of longs from a long array or some other long buffer into this buffer; and

  • Methods for compacting, duplicating, and slicing a long buffer.

Long buffers can be created either by allocation, which allocates space for the buffer's content, by wrapping an existing long array into a buffer, or by creating a view of an existing byte buffer.

Like a byte buffer, a long buffer is either direct or non-direct. A long buffer created via the wrap methods of this class will be non-direct. A long buffer created as a view of a byte buffer will be direct if, and only if, the byte buffer itself is direct. Whether or not a long buffer is direct may be determined by invoking the isDirect method.

Methods in this class that do not otherwise have a value to return are specified to return the buffer upon which they are invoked. This allows method invocations to be chained.

Public Method Summary

static LongBuffer
allocate(int capacity)
Allocates a new long buffer.
final long[]
array()
Returns the long array that backs this buffer  (optional operation).
final int
arrayOffset()
Returns the offset within this buffer's backing array of the first element of the buffer  (optional operation).
abstract LongBuffer
asReadOnlyBuffer()
Creates a new, read-only long buffer that shares this buffer's content.
abstract LongBuffer
compact()
Compacts this buffer  (optional operation).
int
compareTo(LongBuffer that)
Compares this buffer to another.
abstract LongBuffer
duplicate()
Creates a new long buffer that shares this buffer's content.
boolean
equals(Object ob)
Tells whether or not this buffer is equal to another object.
LongBuffer
get(long[] dst, int offset, int length)
Relative bulk get method.
LongBuffer
get(long[] dst)
Relative bulk get method.
abstract long
get()
Relative get method.
abstract long
get(int index)
Absolute get method.
final boolean
hasArray()
Tells whether or not this buffer is backed by an accessible long array.
int
hashCode()
Returns the current hash code of this buffer.
abstract boolean
isDirect()
Tells whether or not this long buffer is direct.
abstract ByteOrder
order()
Retrieves this buffer's byte order.
abstract LongBuffer
put(long l)
Relative put method  (optional operation).
LongBuffer
put(LongBuffer src)
Relative bulk put method  (optional operation).
LongBuffer
put(long[] src, int offset, int length)
Relative bulk put method  (optional operation).
abstract LongBuffer
put(int index, long l)
Absolute put method  (optional operation).
final LongBuffer
put(long[] src)
Relative bulk put method  (optional operation).
abstract LongBuffer
slice()
Creates a new long buffer whose content is a shared subsequence of this buffer's content.
String
toString()
Returns a string summarizing the state of this buffer.
static LongBuffer
wrap(long[] array)
Wraps a long array into a buffer.
static LongBuffer
wrap(long[] array, int offset, int length)
Wraps a long array into a buffer.

Inherited Method Summary