Methods Summary |
---|
static native int | _allocNative(int capacity)
|
static native void | _copyBytes(int srcAddress, int dstAddress, int bytes)
|
static native byte | _getByte(int address)
|
static native void | _getBytes(int address, byte[] dst, int offset, int length)
|
static native float | _getFloat(int address)
|
static native void | _getFloats(int address, float[] dst, int offset, int length)
|
static native int | _getInt(int address)
|
static native void | _getInts(int address, int[] dst, int offset, int length)
|
static native short | _getShort(int address)
|
static native void | _getShorts(int address, short[] dst, int offset, int length)
|
static native void | _putByte(int address, byte value)
|
static native void | _putBytes(int address, byte[] dst, int offset, int length)
|
static native void | _putFloat(int address, float value)
|
static native void | _putFloats(int address, float[] dst, int offset, int length)
|
static native void | _putInt(int address, int value)
|
static native void | _putInts(int address, int[] dst, int offset, int length)
|
static native void | _putShort(int address, short value)
|
static native void | _putShorts(int address, short[] dst, int offset, int length)
|
public java.nio.FloatBuffer | asFloatBuffer()
int pos = position + (isDirect ? arrayOffset : 0);
return new FloatBufferImpl(this, remaining() >> 2,
null, pos, isDirect);
|
public java.nio.IntBuffer | asIntBuffer()
int pos = position + (isDirect ? arrayOffset : 0);
return new IntBufferImpl(this, remaining() >> 2,
null, pos, isDirect);
|
public java.nio.ShortBuffer | asShortBuffer()
int pos = position + (isDirect ? arrayOffset : 0);
return new ShortBufferImpl(this, remaining() >> 1,
null, pos, isDirect);
|
public void | dispose()
// Need revisit
this.disposed = true;
|
private native void | finalize()
|
public byte | get()
if (position >= limit) {
throw new BufferUnderflowException();
}
return get(position++);
|
public byte | get(int index)
if (index < 0 || index >= limit) {
throw new IndexOutOfBoundsException();
}
if (isDirect) {
return _getByte(arrayOffset + index);
} else {
return array[arrayOffset + index];
}
|
public float | getFloat()
return Float.intBitsToFloat(getInt());
|
public float | getFloat(int index)
return Float.intBitsToFloat(getInt(index));
|
public int | getInt()
if (position >= limit - 3) {
throw new BufferUnderflowException();
}
int x = getInt(position);
position += 4;
return x;
|
public int | getInt(int index)
if (index < 0 || index >= limit - 3) {
throw new IndexOutOfBoundsException();
}
int x0, x1, x2, x3;
if (isDirect) {
index += arrayOffset;
x0 = _getByte(index++);
x1 = _getByte(index++);
x2 = _getByte(index++);
x3 = _getByte(index);
} else {
index += arrayOffset;
x0 = array[index++];
x1 = array[index++];
x2 = array[index++];
x3 = array[index++];
}
if (GLConfiguration.IS_BIG_ENDIAN) {
return (( x0 << 24) |
((x1 & 0xff) << 16) |
((x2 & 0xff) << 8) |
(x3 & 0xff));
} else {
return (( x3 << 24) |
((x2 & 0xff) << 16) |
((x1 & 0xff) << 8) |
(x0 & 0xff));
}
|
public short | getShort()
if (position >= limit - 1) {
throw new BufferUnderflowException();
}
short s = getShort(position);
position += 2;
return s;
|
public short | getShort(int index)
if (index < 0 || index >= limit - 1) {
throw new IndexOutOfBoundsException();
}
int x0, x1;
if (isDirect) {
index += arrayOffset;
x0 = _getByte(index++);
x1 = _getByte(index++);
} else {
index += arrayOffset;
x0 = array[index++];
x1 = array[index++];
}
if (GLConfiguration.IS_BIG_ENDIAN) {
return (short)(((x0 & 0xff) << 8) | (x1 & 0xff));
} else {
return (short)(((x1 & 0xff) << 8) | (x0 & 0xff));
}
|
public static boolean | isBigEndian()
return GLConfiguration.IS_BIG_ENDIAN;
|
public boolean | isDirect()
return isDirect;
|
public int | nativeAddress()
return arrayOffset;
|
public java.nio.ByteBuffer | put(byte b)
if (position >= limit) {
throw new BufferOverflowException();
}
return put(position++, b);
|
public java.nio.ByteBuffer | put(int index, byte b)
if (index < 0 || index >= limit) {
throw new IndexOutOfBoundsException();
}
if (isDirect) {
_putByte(arrayOffset + index, b);
} else {
array[arrayOffset + index] = b;
}
return this;
|
public java.nio.ByteBuffer | putFloat(float value)
return putInt(Float.floatToIntBits(value));
|
public java.nio.ByteBuffer | putFloat(int index, float value)
return putInt(index, Float.floatToIntBits(value));
|
public java.nio.ByteBuffer | putInt(int value)
if (position >= limit - 3) {
throw new BufferOverflowException();
}
putInt(position, value);
position += 4;
return this;
|
public java.nio.ByteBuffer | putInt(int index, int value)
if (index < 0 || index >= limit - 3) {
throw new IndexOutOfBoundsException();
}
byte x0, x1, x2, x3;
if (GLConfiguration.IS_BIG_ENDIAN) {
x0 = (byte)(value >> 24);
x1 = (byte)(value >> 16);
x2 = (byte)(value >> 8);
x3 = (byte)(value);
} else {
x3 = (byte)(value >> 24);
x2 = (byte)(value >> 16);
x1 = (byte)(value >> 8);
x0 = (byte)(value);
}
if (isDirect) {
index += arrayOffset;
_putByte(index++, x0);
_putByte(index++, x1);
_putByte(index++, x2);
_putByte(index, x3);
} else {
index += arrayOffset;
array[index++] = x0;
array[index++] = x1;
array[index++] = x2;
array[index ] = x3;
}
return this;
|
public java.nio.ByteBuffer | putShort(short value)
if (position >= limit - 1) {
throw new BufferOverflowException();
}
putShort(position, value);
position += 2;
return this;
|
public java.nio.ByteBuffer | putShort(int index, short value)
if (index < 0 || index >= limit - 1) {
throw new IndexOutOfBoundsException();
}
byte x0, x1;
if (GLConfiguration.IS_BIG_ENDIAN) {
x0 = (byte)(value >> 8);
x1 = (byte)(value);
} else {
x1 = (byte)(value >> 8);
x0 = (byte)(value);
}
if (isDirect) {
index += arrayOffset;
_putByte(index++, x0);
_putByte(index, x1);
} else {
index += arrayOffset;
array[index++] = x0;
array[index ] = x1;
}
return this;
|
public java.nio.ByteBuffer | slice()
return new ByteBufferImpl(limit - position, array,
arrayOffset + position, this);
|