Package org.lwjgl
Class MemoryUtil
java.lang.Object
org.lwjgl.MemoryUtil
[INTERNAL USE ONLY]
This class provides utility methods for passing buffers to JNI API calls.
- Author:
- Spasi
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringdecodeASCII(ByteBuffer buffer) static StringdecodeUTF16(ByteBuffer buffer) static StringdecodeUTF8(ByteBuffer buffer) static ByteBufferencodeASCII(CharSequence text) Returns a ByteBuffer containing the specified text ASCII encoded and null-terminated.static ByteBufferencodeUTF16(CharSequence text) Returns a ByteBuffer containing the specified text UTF-16LE encoded and null-terminated.static ByteBufferencodeUTF8(CharSequence text) Returns a ByteBuffer containing the specified text UTF-8 encoded and null-terminated.static longgetAddress(ByteBuffer buffer) static longgetAddress(ByteBuffer buffer, int position) static longgetAddress(CharBuffer buffer) static longgetAddress(CharBuffer buffer, int position) static longgetAddress(DoubleBuffer buffer) static longgetAddress(DoubleBuffer buffer, int position) static longgetAddress(FloatBuffer buffer) static longgetAddress(FloatBuffer buffer, int position) static longgetAddress(IntBuffer buffer) static longgetAddress(IntBuffer buffer, int position) static longgetAddress(LongBuffer buffer) static longgetAddress(LongBuffer buffer, int position) static longgetAddress(ShortBuffer buffer) static longgetAddress(ShortBuffer buffer, int position) static longgetAddress(PointerBuffer buffer) static longgetAddress(PointerBuffer buffer, int position) static longgetAddress0(Buffer buffer) Returns the memory address of the specified buffer.static longgetAddress0(PointerBuffer buffer) static longgetAddress0Safe(Buffer buffer) static longgetAddress0Safe(PointerBuffer buffer) static longgetAddressSafe(ByteBuffer buffer) static longgetAddressSafe(ByteBuffer buffer, int position) static longgetAddressSafe(CharBuffer buffer) static longgetAddressSafe(CharBuffer buffer, int position) static longgetAddressSafe(DoubleBuffer buffer) static longgetAddressSafe(DoubleBuffer buffer, int position) static longgetAddressSafe(FloatBuffer buffer) static longgetAddressSafe(FloatBuffer buffer, int position) static longgetAddressSafe(IntBuffer buffer) static longgetAddressSafe(IntBuffer buffer, int position) static longgetAddressSafe(LongBuffer buffer) static longgetAddressSafe(LongBuffer buffer, int position) static longgetAddressSafe(ShortBuffer buffer) static longgetAddressSafe(ShortBuffer buffer, int position) static longgetAddressSafe(PointerBuffer buffer) static longgetAddressSafe(PointerBuffer buffer, int position)
-
Method Details
-
getAddress0
Returns the memory address of the specified buffer. [INTERNAL USE ONLY]- Parameters:
buffer- the buffer- Returns:
- the memory address
-
getAddress0Safe
-
getAddress0
-
getAddress0Safe
-
getAddress
-
getAddress
-
getAddress
-
getAddress
-
getAddress
-
getAddress
-
getAddress
-
getAddress
-
getAddress
-
getAddress
-
getAddress
-
getAddress
-
getAddress
-
getAddress
-
getAddress
-
getAddress
-
getAddressSafe
-
getAddressSafe
-
getAddressSafe
-
getAddressSafe
-
getAddressSafe
-
getAddressSafe
-
getAddressSafe
-
getAddressSafe
-
getAddressSafe
-
getAddressSafe
-
getAddressSafe
-
getAddressSafe
-
getAddressSafe
-
getAddressSafe
-
getAddressSafe
-
getAddressSafe
-
encodeASCII
Returns a ByteBuffer containing the specified text ASCII encoded and null-terminated. If text is null, null is returned.- Parameters:
text- the text to encode- Returns:
- the encoded text or null
- See Also:
-
encodeUTF8
Returns a ByteBuffer containing the specified text UTF-8 encoded and null-terminated. If text is null, null is returned.- Parameters:
text- the text to encode- Returns:
- the encoded text or null
- See Also:
-
encodeUTF16
Returns a ByteBuffer containing the specified text UTF-16LE encoded and null-terminated. If text is null, null is returned.- Parameters:
text- the text to encode- Returns:
- the encoded text
-
decodeASCII
-
decodeUTF8
-
decodeUTF16
-