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