public final class NativeUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static byte |
NULL |
| Modifier and Type | Method and Description |
|---|---|
static long |
addressOrNull(ArrowBuf buf)
Get the address of a buffer or 0 if the input buffer is null.
|
static long |
addressOrNull(BaseStruct struct)
Get the address of a C Data Interface struct or 0 if the input
struct is null.
|
static void |
closeBuffer(ArrowBuf buf)
Close a buffer if it's not null.
|
static long[] |
toJavaArray(long arrayPtr,
int size)
Convert a native array pointer (void**) to Java array of pointers.
|
static String |
toJavaString(long cstringPtr)
Convert a pointer to a null terminated string into a Java String.
|
static ArrowBuf |
toNativeString(BufferAllocator allocator,
String string)
Convert Java string to a null terminated string.
|
public static final byte NULL
public static String toJavaString(long cstringPtr)
cstringPtr - pointer to C stringpublic static long[] toJavaArray(long arrayPtr,
int size)
arrayPtr - Array pointersize - Array sizepublic static ArrowBuf toNativeString(BufferAllocator allocator, String string)
allocator - Buffer allocator for allocating the native stringstring - Input String to convertpublic static void closeBuffer(ArrowBuf buf)
buf - Buffer to closepublic static long addressOrNull(ArrowBuf buf)
buf - Buffer to get the address ofpublic static long addressOrNull(BaseStruct struct)
struct - C Data Interface struct to get the address ofCopyright © 2024 The Apache Software Foundation. All rights reserved.