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 String
decodeASCII
(ByteBuffer buffer) static String
decodeUTF16
(ByteBuffer buffer) static String
decodeUTF8
(ByteBuffer buffer) static ByteBuffer
encodeASCII
(CharSequence text) Returns a ByteBuffer containing the specified text ASCII encoded and null-terminated.static ByteBuffer
encodeUTF16
(CharSequence text) Returns a ByteBuffer containing the specified text UTF-16LE encoded and null-terminated.static ByteBuffer
encodeUTF8
(CharSequence text) Returns a ByteBuffer containing the specified text UTF-8 encoded and null-terminated.static long
getAddress
(ByteBuffer buffer) static long
getAddress
(ByteBuffer buffer, int position) static long
getAddress
(CharBuffer buffer) static long
getAddress
(CharBuffer buffer, int position) static long
getAddress
(DoubleBuffer buffer) static long
getAddress
(DoubleBuffer buffer, int position) static long
getAddress
(FloatBuffer buffer) static long
getAddress
(FloatBuffer buffer, int position) static long
getAddress
(IntBuffer buffer) static long
getAddress
(IntBuffer buffer, int position) static long
getAddress
(LongBuffer buffer) static long
getAddress
(LongBuffer buffer, int position) static long
getAddress
(ShortBuffer buffer) static long
getAddress
(ShortBuffer buffer, int position) static long
getAddress
(PointerBuffer buffer) static long
getAddress
(PointerBuffer buffer, int position) static long
getAddress0
(Buffer buffer) Returns the memory address of the specified buffer.static long
getAddress0
(PointerBuffer buffer) static long
getAddress0Safe
(Buffer buffer) static long
getAddress0Safe
(PointerBuffer buffer) static long
getAddressSafe
(ByteBuffer buffer) static long
getAddressSafe
(ByteBuffer buffer, int position) static long
getAddressSafe
(CharBuffer buffer) static long
getAddressSafe
(CharBuffer buffer, int position) static long
getAddressSafe
(DoubleBuffer buffer) static long
getAddressSafe
(DoubleBuffer buffer, int position) static long
getAddressSafe
(FloatBuffer buffer) static long
getAddressSafe
(FloatBuffer buffer, int position) static long
getAddressSafe
(IntBuffer buffer) static long
getAddressSafe
(IntBuffer buffer, int position) static long
getAddressSafe
(LongBuffer buffer) static long
getAddressSafe
(LongBuffer buffer, int position) static long
getAddressSafe
(ShortBuffer buffer) static long
getAddressSafe
(ShortBuffer buffer, int position) static long
getAddressSafe
(PointerBuffer buffer) static long
getAddressSafe
(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
-