Package org.lwjgl
Class BufferChecks
java.lang.Object
org.lwjgl.BufferChecks
A class to check buffer boundaries in general. If there is unsufficient space in the buffer when the call is made then a buffer overflow would otherwise occur and cause unexpected behaviour, a crash, or worse, a security risk. Internal class, don't use.
- Version:
- $Revision$ $Id$
- Author:
- cix_foo invalid input: '<'cix_foo@users.sourceforge.net>, elias_naur invalid input: '<'elias_naur@users.sourceforge.net>
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckArray(long[] array, int size) static voidcheckArray(Object[] array) static voidcheckArray(Object[] array, int size) static intcheckBuffer(Buffer buffer, int size) Detects the buffer type and performs the corresponding check and also returns the buffer position in bytes.static voidcheckBuffer(ByteBuffer buf, int size) static voidcheckBuffer(DoubleBuffer buf, int size) static voidcheckBuffer(FloatBuffer buf, int size) static voidcheckBuffer(IntBuffer buf, int size) static voidcheckBuffer(LongBuffer buf, int size) static voidcheckBuffer(ShortBuffer buf, int size) static voidcheckBuffer(PointerBuffer buf, int size) static voidcheckBufferSize(Buffer buf, int size) Helper method to ensure a buffer is big enough to receive data from a glGet* operation.static voidcheckDirect(ByteBuffer buf) Helper methods to ensure a buffer is direct (and, implicitly, non-null).static voidcheckDirect(DoubleBuffer buf) static voidcheckDirect(FloatBuffer buf) static voidcheckDirect(IntBuffer buf) static voidcheckDirect(LongBuffer buf) static voidcheckDirect(ShortBuffer buf) static voidcheckDirect(PointerBuffer buf) static voidcheckFunctionAddress(long pointer) Helper methods to ensure a function pointer is not-null (0)static voidstatic voidHelper methods to ensure a ByteBuffer is null-terminatedstatic voidcheckNullTerminated(ByteBuffer buf, int count) static voidHelper method to ensure an IntBuffer is null-terminatedstatic voidHelper method to ensure a LongBuffer is null-terminatedstatic voidHelper method to ensure a PointerBuffer is null-terminated
-
Method Details
-
checkFunctionAddress
public static void checkFunctionAddress(long pointer) Helper methods to ensure a function pointer is not-null (0) -
checkNullTerminated
Helper methods to ensure a ByteBuffer is null-terminated -
checkNullTerminated
-
checkNullTerminated
Helper method to ensure an IntBuffer is null-terminated -
checkNullTerminated
Helper method to ensure a LongBuffer is null-terminated -
checkNullTerminated
Helper method to ensure a PointerBuffer is null-terminated -
checkNotNull
-
checkDirect
Helper methods to ensure a buffer is direct (and, implicitly, non-null). -
checkDirect
-
checkDirect
-
checkDirect
-
checkDirect
-
checkDirect
-
checkDirect
-
checkArray
-
checkBufferSize
Helper method to ensure a buffer is big enough to receive data from a glGet* operation.- Parameters:
buf- The buffer to checksize- The minimum buffer size- Throws:
IllegalArgumentException
-
checkBuffer
Detects the buffer type and performs the corresponding check and also returns the buffer position in bytes.- Parameters:
buffer- the buffer to checksize- the size to check- Returns:
- the buffer position in bytes
-
checkBuffer
-
checkBuffer
-
checkBuffer
-
checkBuffer
-
checkBuffer
-
checkBuffer
-
checkBuffer
-
checkArray
-
checkArray
public static void checkArray(long[] array, int size)
-