public class BufferChecks
extends java.lang.Object
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.
Modifier and Type | Method and Description |
---|---|
static void |
checkArray(long[] array,
int size) |
static void |
checkArray(java.lang.Object[] array) |
static void |
checkArray(java.lang.Object[] array,
int size) |
static int |
checkBuffer(java.nio.Buffer buffer,
int size)
Detects the buffer type and performs the corresponding check
and also returns the buffer position in bytes.
|
static void |
checkBuffer(java.nio.ByteBuffer buf,
int size) |
static void |
checkBuffer(java.nio.DoubleBuffer buf,
int size) |
static void |
checkBuffer(java.nio.FloatBuffer buf,
int size) |
static void |
checkBuffer(java.nio.IntBuffer buf,
int size) |
static void |
checkBuffer(java.nio.LongBuffer buf,
int size) |
static void |
checkBuffer(PointerBuffer buf,
int size) |
static void |
checkBuffer(java.nio.ShortBuffer buf,
int size) |
static void |
checkBufferSize(java.nio.Buffer buf,
int size)
Helper method to ensure a buffer is big enough to receive data from a
glGet* operation.
|
static void |
checkDirect(java.nio.ByteBuffer buf)
Helper methods to ensure a buffer is direct (and, implicitly, non-null).
|
static void |
checkDirect(java.nio.DoubleBuffer buf) |
static void |
checkDirect(java.nio.FloatBuffer buf) |
static void |
checkDirect(java.nio.IntBuffer buf) |
static void |
checkDirect(java.nio.LongBuffer buf) |
static void |
checkDirect(PointerBuffer buf) |
static void |
checkDirect(java.nio.ShortBuffer buf) |
static void |
checkFunctionAddress(long pointer)
Helper methods to ensure a function pointer is not-null (0)
|
static void |
checkNotNull(java.lang.Object o) |
static void |
checkNullTerminated(java.nio.ByteBuffer buf)
Helper methods to ensure a ByteBuffer is null-terminated
|
static void |
checkNullTerminated(java.nio.ByteBuffer buf,
int count) |
static void |
checkNullTerminated(java.nio.IntBuffer buf)
Helper method to ensure an IntBuffer is null-terminated
|
static void |
checkNullTerminated(java.nio.LongBuffer buf)
Helper method to ensure a LongBuffer is null-terminated
|
static void |
checkNullTerminated(PointerBuffer buf)
Helper method to ensure a PointerBuffer is null-terminated
|
public static void checkFunctionAddress(long pointer)
public static void checkNullTerminated(java.nio.ByteBuffer buf)
public static void checkNullTerminated(java.nio.ByteBuffer buf, int count)
public static void checkNullTerminated(java.nio.IntBuffer buf)
public static void checkNullTerminated(java.nio.LongBuffer buf)
public static void checkNullTerminated(PointerBuffer buf)
public static void checkNotNull(java.lang.Object o)
public static void checkDirect(java.nio.ByteBuffer buf)
public static void checkDirect(java.nio.ShortBuffer buf)
public static void checkDirect(java.nio.IntBuffer buf)
public static void checkDirect(java.nio.LongBuffer buf)
public static void checkDirect(java.nio.FloatBuffer buf)
public static void checkDirect(java.nio.DoubleBuffer buf)
public static void checkDirect(PointerBuffer buf)
public static void checkArray(java.lang.Object[] array)
public static void checkBufferSize(java.nio.Buffer buf, int size)
buf
- The buffer to checksize
- The minimum buffer sizejava.lang.IllegalArgumentException
public static int checkBuffer(java.nio.Buffer buffer, int size)
buffer
- the buffer to checksize
- the size to checkpublic static void checkBuffer(java.nio.ByteBuffer buf, int size)
public static void checkBuffer(java.nio.ShortBuffer buf, int size)
public static void checkBuffer(java.nio.IntBuffer buf, int size)
public static void checkBuffer(java.nio.LongBuffer buf, int size)
public static void checkBuffer(java.nio.FloatBuffer buf, int size)
public static void checkBuffer(java.nio.DoubleBuffer buf, int size)
public static void checkBuffer(PointerBuffer buf, int size)
public static void checkArray(java.lang.Object[] array, int size)
public static void checkArray(long[] array, int size)
Copyright © 2002-2009 lwjgl.org. All Rights Reserved.