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