com.sun.opengl.util
Class BufferUtil
Utility routines for dealing with direct buffers.
static ByteBuffer | copyByteBuffer(ByteBuffer orig) - Copies the remaining elements (as defined by
limit() - position() ) in the passed ByteBuffer into
a newly-allocated direct ByteBuffer.
|
static DoubleBuffer | copyDoubleBuffer(DoubleBuffer orig) - Copies the remaining elements (as defined by
limit() - position() ) in the passed DoubleBuffer
into a newly-allocated direct DoubleBuffer.
|
static ByteBuffer | copyDoubleBufferAsByteBuffer(DoubleBuffer orig) - Copies the remaining elements (as defined by
limit() - position() ) in the passed DoubleBuffer
into a newly-allocated direct ByteBuffer.
|
static FloatBuffer | copyFloatBuffer(FloatBuffer orig) - Copies the remaining elements (as defined by
limit() - position() ) in the passed FloatBuffer
into a newly-allocated direct FloatBuffer.
|
static ByteBuffer | copyFloatBufferAsByteBuffer(FloatBuffer orig) - Copies the remaining elements (as defined by
limit() - position() ) in the passed FloatBuffer
into a newly-allocated direct ByteBuffer.
|
static IntBuffer | copyIntBuffer(IntBuffer orig) - Copies the remaining elements (as defined by
limit() - position() ) in the passed IntBuffer
into a newly-allocated direct IntBuffer.
|
static ByteBuffer | copyIntBufferAsByteBuffer(IntBuffer orig) - Copies the remaining elements (as defined by
limit() - position() ) in the passed IntBuffer into
a newly-allocated direct ByteBuffer.
|
static LongBuffer | copyLongBuffer(LongBuffer orig) - Copies the remaining elements (as defined by
limit() - position() ) in the passed LongBuffer
into a newly-allocated direct LongBuffer.
|
static ByteBuffer | copyLongBufferAsByteBuffer(LongBuffer orig) - Copies the remaining elements (as defined by
limit() - position() ) in the passed LongBuffer into
a newly-allocated direct ByteBuffer.
|
static ShortBuffer | copyShortBuffer(ShortBuffer orig) - Copies the remaining elements (as defined by
limit() - position() ) in the passed ShortBuffer
into a newly-allocated direct ShortBuffer.
|
static ByteBuffer | copyShortBufferAsByteBuffer(ShortBuffer orig) - Copies the remaining elements (as defined by
limit() - position() ) in the passed ShortBuffer
into a newly-allocated direct ByteBuffer.
|
static ByteBuffer | newByteBuffer(int numElements) - Allocates a new direct ByteBuffer with the specified number of
elements.
|
static DoubleBuffer | newDoubleBuffer(int numElements) - Allocates a new direct DoubleBuffer with the specified number of
elements.
|
static FloatBuffer | newFloatBuffer(int numElements) - Allocates a new direct FloatBuffer with the specified number of
elements.
|
static IntBuffer | newIntBuffer(int numElements) - Allocates a new direct IntBuffer with the specified number of
elements.
|
static LongBuffer | newLongBuffer(int numElements) - Allocates a new direct LongBuffer with the specified number of
elements.
|
static ShortBuffer | newShortBuffer(int numElements) - Allocates a new direct ShortBuffer with the specified number of
elements.
|
SIZEOF_BYTE
public static final int SIZEOF_BYTE
SIZEOF_DOUBLE
public static final int SIZEOF_DOUBLE
SIZEOF_FLOAT
public static final int SIZEOF_FLOAT
SIZEOF_INT
public static final int SIZEOF_INT
SIZEOF_LONG
public static final int SIZEOF_LONG
SIZEOF_SHORT
public static final int SIZEOF_SHORT
copyByteBuffer
public static ByteBuffer copyByteBuffer(ByteBuffer orig)
Copies the remaining elements (as defined by
limit() - position()
) in the passed ByteBuffer into
a newly-allocated direct ByteBuffer. The returned buffer will
have its byte order set to the host platform's native byte
order. The position of the newly-allocated buffer will be zero,
and the position of the passed buffer is unchanged (though its
mark is changed).
copyDoubleBuffer
public static DoubleBuffer copyDoubleBuffer(DoubleBuffer orig)
Copies the remaining elements (as defined by
limit() - position()
) in the passed DoubleBuffer
into a newly-allocated direct DoubleBuffer. The returned buffer
will have its byte order set to the host platform's native byte
order. The position of the newly-allocated buffer will be zero,
and the position of the passed buffer is unchanged (though its
mark is changed).
copyDoubleBufferAsByteBuffer
public static ByteBuffer copyDoubleBufferAsByteBuffer(DoubleBuffer orig)
Copies the remaining elements (as defined by
limit() - position()
) in the passed DoubleBuffer
into a newly-allocated direct ByteBuffer. The returned buffer
will have its byte order set to the host platform's native byte
order. The position of the newly-allocated buffer will be zero,
and the position of the passed buffer is unchanged (though its
mark is changed).
copyFloatBuffer
public static FloatBuffer copyFloatBuffer(FloatBuffer orig)
Copies the remaining elements (as defined by
limit() - position()
) in the passed FloatBuffer
into a newly-allocated direct FloatBuffer. The returned buffer
will have its byte order set to the host platform's native byte
order. The position of the newly-allocated buffer will be zero,
and the position of the passed buffer is unchanged (though its
mark is changed).
copyFloatBufferAsByteBuffer
public static ByteBuffer copyFloatBufferAsByteBuffer(FloatBuffer orig)
Copies the remaining elements (as defined by
limit() - position()
) in the passed FloatBuffer
into a newly-allocated direct ByteBuffer. The returned buffer
will have its byte order set to the host platform's native byte
order. The position of the newly-allocated buffer will be zero,
and the position of the passed buffer is unchanged (though its
mark is changed).
copyIntBuffer
public static IntBuffer copyIntBuffer(IntBuffer orig)
Copies the remaining elements (as defined by
limit() - position()
) in the passed IntBuffer
into a newly-allocated direct IntBuffer. The returned buffer
will have its byte order set to the host platform's native byte
order. The position of the newly-allocated buffer will be zero,
and the position of the passed buffer is unchanged (though its
mark is changed).
copyIntBufferAsByteBuffer
public static ByteBuffer copyIntBufferAsByteBuffer(IntBuffer orig)
Copies the remaining elements (as defined by
limit() - position()
) in the passed IntBuffer into
a newly-allocated direct ByteBuffer. The returned buffer will
have its byte order set to the host platform's native byte
order. The position of the newly-allocated buffer will be zero,
and the position of the passed buffer is unchanged (though its
mark is changed).
copyLongBuffer
public static LongBuffer copyLongBuffer(LongBuffer orig)
Copies the remaining elements (as defined by
limit() - position()
) in the passed LongBuffer
into a newly-allocated direct LongBuffer. The returned buffer
will have its byte order set to the host platform's native byte
order. The position of the newly-allocated buffer will be zero,
and the position of the passed buffer is unchanged (though its
mark is changed).
copyLongBufferAsByteBuffer
public static ByteBuffer copyLongBufferAsByteBuffer(LongBuffer orig)
Copies the remaining elements (as defined by
limit() - position()
) in the passed LongBuffer into
a newly-allocated direct ByteBuffer. The returned buffer will
have its byte order set to the host platform's native byte
order. The position of the newly-allocated buffer will be zero,
and the position of the passed buffer is unchanged (though its
mark is changed).
copyShortBuffer
public static ShortBuffer copyShortBuffer(ShortBuffer orig)
Copies the remaining elements (as defined by
limit() - position()
) in the passed ShortBuffer
into a newly-allocated direct ShortBuffer. The returned buffer
will have its byte order set to the host platform's native byte
order. The position of the newly-allocated buffer will be zero,
and the position of the passed buffer is unchanged (though its
mark is changed).
copyShortBufferAsByteBuffer
public static ByteBuffer copyShortBufferAsByteBuffer(ShortBuffer orig)
Copies the remaining elements (as defined by
limit() - position()
) in the passed ShortBuffer
into a newly-allocated direct ByteBuffer. The returned buffer
will have its byte order set to the host platform's native byte
order. The position of the newly-allocated buffer will be zero,
and the position of the passed buffer is unchanged (though its
mark is changed).
newByteBuffer
public static ByteBuffer newByteBuffer(int numElements)
Allocates a new direct ByteBuffer with the specified number of
elements. The returned buffer will have its byte order set to
the host platform's native byte order.
newDoubleBuffer
public static DoubleBuffer newDoubleBuffer(int numElements)
Allocates a new direct DoubleBuffer with the specified number of
elements. The returned buffer will have its byte order set to
the host platform's native byte order.
newFloatBuffer
public static FloatBuffer newFloatBuffer(int numElements)
Allocates a new direct FloatBuffer with the specified number of
elements. The returned buffer will have its byte order set to
the host platform's native byte order.
newIntBuffer
public static IntBuffer newIntBuffer(int numElements)
Allocates a new direct IntBuffer with the specified number of
elements. The returned buffer will have its byte order set to
the host platform's native byte order.
newLongBuffer
public static LongBuffer newLongBuffer(int numElements)
Allocates a new direct LongBuffer with the specified number of
elements. The returned buffer will have its byte order set to
the host platform's native byte order.
newShortBuffer
public static ShortBuffer newShortBuffer(int numElements)
Allocates a new direct ShortBuffer with the specified number of
elements. The returned buffer will have its byte order set to
the host platform's native byte order.
Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.