public class ExternalArrayPointer extends Pointer
Memory allocated to this array is considered external
and, therefore, cannot be reallocated and will not be freed by JNIWrapper.
If the passed array is correctly reallocated by the caller, use ResizingPointer
instead of this class.
Pointer.Const, Pointer.OutOnly, Pointer.Void
POINTER_LENGTH
LICENSE_TYPE, V
Constructor and Description |
---|
ExternalArrayPointer(ArrayParameter array)
Constructs a new pointer to the given array.
|
ExternalArrayPointer(ArrayParameter array,
boolean isNull)
Constructs a new pointer to the given array.
|
Modifier and Type | Method and Description |
---|---|
Parameter |
getReferencedObject()
Returns the referenced object of this pointer.
|
void |
read(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Reads this parameter from a specified data source.
|
void |
readArray(int count)
Reads the resized array.
|
protected void |
readReferencedObject(boolean invokedByCallback)
Reads the referenced object only.
|
protected void |
setExternalSource(long newHandle,
int length)
Makes this pointer use external (unmanaged) memory area.
|
void |
write(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Writes this parameter to a specified data source.
|
acceptIOPerformer, asTypedPointer, asVoidPointer, castTo, castTo, checkMemHandleLength, clone, equals, getDebugInfo, getLength, getParameterClass, getPointerHandle, isNull, pop, push, read, readPointer, setNull, setReferencedObject, setReferencedObject, write, writePointer, writeReferencedObject
asReturnValue, dataBufferAssigned, getAlignedLength, getAlignmentRequirement, getDataBuffer, getDataBufferOffset, hashCode, indent, read, setDataBuffer, toByteArray
public ExternalArrayPointer(ArrayParameter array)
public ExternalArrayPointer(ArrayParameter array, boolean isNull)
array
- isNull
- the pointer passed to the function will be initially null
if this parameter is true true
.public void read(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameter
read
in class Pointer
MemoryAccessViolationException
public void write(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameter
write
in class Pointer
MemoryAccessViolationException
protected void readReferencedObject(boolean invokedByCallback)
Pointer
readReferencedObject
in class Pointer
public Parameter getReferencedObject()
Pointer
getReferencedObject
in class Pointer
protected void setExternalSource(long newHandle, int length)
Pointer
setExternalSource
in class Pointer
newHandle
- memory handlelength
- known allocated lengthpublic void readArray(int count)
count
- new element count.