public final class NativeHandle extends Object implements AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
static long |
INVALID_NATIVE_HANDLE
A reserved value for an invalid native handle, equal to
nullptr in C++. |
| Constructor and Description |
|---|
NativeHandle(long nativeHandle)
Creates new native handle.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
get()
Returns a native implementation-specific handle if it may be safely used
to access the native object.
|
String |
toString() |
public static final long INVALID_NATIVE_HANDLE
nullptr in C++.public NativeHandle(long nativeHandle)
IllegalStateException - if this native handle is invalid (nullptr)public long get()
The returned value shall only be passed as an argument to native methods.
Warning: do not cache the return value, as you won't be able to catch use-after-free.
IllegalStateException - if this native handle is invalid (closed or nullptr)public void close()
close in interface AutoCloseableCopyright © 2019 Exonum. All rights reserved.