public final class NativeHandle
extends java.lang.Object
implements java.lang.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) |
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.
|
public static final long INVALID_NATIVE_HANDLE
nullptr
in C++.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.
java.lang.IllegalStateException
- if this native handle is invalid (closed or nullptr)public void close()
close
in interface java.lang.AutoCloseable
Copyright © 2018 Exonum. All rights reserved.