public class FastLongBuffer
extends java.lang.Object
long buffer.
This buffer implementation does not store all data
in single array, but in array of chunks.| Constructor and Description |
|---|
FastLongBuffer()
Creates a new
long buffer. |
FastLongBuffer(int size)
Creates a new
long buffer, with a buffer capacity of
the specified size, in bytes. |
| Modifier and Type | Method and Description |
|---|---|
FastLongBuffer |
append(FastLongBuffer buff)
Appends another fast buffer to this one.
|
FastLongBuffer |
append(long element)
Appends single
long to buffer. |
FastLongBuffer |
append(long[] array)
Appends
long array to buffer. |
FastLongBuffer |
append(long[] array,
int off,
int len)
Appends
long array to buffer. |
long[] |
array(int index)
Returns
long inner array chunk at given index. |
void |
clear()
Resets the buffer content.
|
long |
get(int index)
Returns
long element at given index. |
int |
index()
Returns current index of inner
long array chunk. |
boolean |
isEmpty()
Tests if this buffer has no elements.
|
int |
offset()
Returns the offset of last used element in current inner array chunk.
|
int |
size()
Returns buffer size.
|
long[] |
toArray()
Creates
long array from buffered content. |
long[] |
toArray(int start,
int len)
Creates
long subarray from buffered content. |
public FastLongBuffer()
long buffer. The buffer capacity is
initially 1024 bytes, though its size increases if necessary.public FastLongBuffer(int size)
long buffer, with a buffer capacity of
the specified size, in bytes.size - the initial size.java.lang.IllegalArgumentException - if size is negative.public FastLongBuffer append(long[] array, int off, int len)
long array to buffer.public FastLongBuffer append(long[] array)
long array to buffer.public FastLongBuffer append(long element)
long to buffer.public FastLongBuffer append(FastLongBuffer buff)
public int size()
public boolean isEmpty()
public int index()
long array chunk.
Represents the index of last used inner array chunk.public int offset()
public long[] array(int index)
long inner array chunk at given index.
May be used for iterating inner chunks in fast manner.public void clear()
public long[] toArray()
long array from buffered content.public long[] toArray(int start,
int len)
long subarray from buffered content.public long get(int index)
long element at given index.Copyright © 2003-2013 Jodd Team