public final class NullMemoryIO extends InAccessibleMemoryIO
Constructor and Description |
---|
NullMemoryIO(Runtime runtime) |
Modifier and Type | Method and Description |
---|---|
long |
address()
Gets the native address of this memory object (optional operation).
|
protected NullPointerException |
error() |
boolean |
isDirect()
Indicates whether or not this memory object represents a native memory address.
|
long |
size()
Gets the size of this memory object (optional operation).
|
array, arrayLength, arrayOffset, get, get, get, get, get, get, getByte, getDouble, getFloat, getInt, getLong, getLongLong, getPointer, getPointer, getShort, getString, getString, hasArray, indexOf, put, put, put, put, put, put, putByte, putDouble, putFloat, putInt, putLong, putLongLong, putPointer, putShort, putString, setMemory
checkBounds, checkBounds, getAddress, getInt, getNativeLong, getRuntime, indexOf, putAddress, putAddress, putInt, putNativeLong, slice, slice, transferFrom, transferTo
get, getNullTerminatedPointerArray, getNullTerminatedStringArray, newIntPointer, put, wrap, wrap, wrap
public NullMemoryIO(Runtime runtime)
protected final NullPointerException error()
error
in class InAccessibleMemoryIO
public final boolean isDirect()
Pointer
Memory objects can be either direct (representing native memory), or non-direct (representing java heap memory).
Non-direct memory objects can still be passed to native functions as pointer (void *, char *, etc) parameters, but the java memory will first be copied to a temporary native memory area. The temporary memory area will then be used as the parameter value for the call. If needed, the java memory will be automatically reloaded from the temporary native memory after the native function returns.
Note: the transient nature of the temporary memory allocated for non-direct memory means native functions which store the address value passed to them will fail in unpredictable ways when using non-direct memory. You will need to explicitly allocate direct memory to use those types of functions.
public long address()
Pointer
public long size()
Pointer
size
in class Pointer
Pointer
points to. If
the size is unknown, Long.MAX_VALUE
is returned}.Copyright © 2013. All rights reserved.