|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.graphics.util.BufferUtil
public final class BufferUtil
Some utils for allocating direct NIO buffers.
| Field Summary | |
|---|---|
static int |
SIZEOF_BYTE
|
static int |
SIZEOF_DOUBLE
|
static int |
SIZEOF_FLOAT
|
static int |
SIZEOF_INT
|
static int |
SIZEOF_LONG
|
static int |
SIZEOF_SHORT
|
| Constructor Summary | |
|---|---|
private |
BufferUtil()
|
| Method Summary | |
|---|---|
static ByteBuffer |
byteBuffer(byte[] a)
Converts an byte array into a direct ByteBuffer. |
static ByteBuffer |
byteBuffer(String s)
Converts a String into a direct ByteBuffer. |
static ByteBuffer |
directByteBuffer(int numElements)
Allocates a new direct ByteBuffer with the specified number of elements. |
static FloatBuffer |
directFloatBuffer(float[] a)
Allocates a new direct FloatBuffer with the specified number of elements. |
static FloatBuffer |
directFloatBuffer(int numElements)
Allocates a new direct FloatBuffer with the specified number of elements. |
static IntBuffer |
directIntBuffer(int numElements)
Allocates a new direct IntBuffer with the specified number of elements. |
static IntBuffer |
directIntBuffer(int[] a)
Allocates a new direct IntBuffer with the specified number of elements. |
static ShortBuffer |
directShortBuffer(int numElements)
Allocates a new direct ShortBuffer with the specified number of elements. |
static FloatBuffer |
floatBuffer(float[] a)
Converts a float array into a direct FloatBuffer. |
static IntBuffer |
intBuffer(int[] a)
Converts an int array into a direct IntBuffer. |
static ShortBuffer |
shortBuffer(short[] a)
Converts an short array into a direct ShortBuffer. |
static ByteBuffer |
stringToNullTerminatedByteBuffer(String s)
Converts a String into a direct ByteBuffer, after adding a null character at the end of the String |
static String |
toString(ByteBuffer buf)
Converts the bytes upto the current Buffer position from ByteBuffer buf into a String. |
static String |
toString(ByteBuffer buf,
int len)
Converts the first len bytes from ByteBuffer buf into a String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SIZEOF_BYTE
public static final int SIZEOF_SHORT
public static final int SIZEOF_INT
public static final int SIZEOF_FLOAT
public static final int SIZEOF_LONG
public static final int SIZEOF_DOUBLE
| Constructor Detail |
|---|
private BufferUtil()
| Method Detail |
|---|
public static FloatBuffer directFloatBuffer(int numElements)
public static FloatBuffer directFloatBuffer(float[] a)
public static IntBuffer directIntBuffer(int numElements)
public static IntBuffer directIntBuffer(int[] a)
public static ShortBuffer directShortBuffer(int numElements)
public static ByteBuffer directByteBuffer(int numElements)
public static IntBuffer intBuffer(int[] a)
public static FloatBuffer floatBuffer(float[] a)
public static ShortBuffer shortBuffer(short[] a)
public static ByteBuffer byteBuffer(byte[] a)
public static ByteBuffer byteBuffer(String s)
public static ByteBuffer stringToNullTerminatedByteBuffer(String s)
public static String toString(ByteBuffer buf,
int len)
public static String toString(ByteBuffer buf)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||