|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jniwrapper.Parameter
com.jniwrapper.Pointer
com.jniwrapper.ExternalArrayPointer
public class ExternalArrayPointer
A pointer to an array returned from the native code. Use this pointer when the returned array size is not known before the native code returns.
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, useResizingPointer
instead of this class.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jniwrapper.Pointer |
---|
Pointer.Const, Pointer.OutOnly, Pointer.Void |
Field Summary |
---|
Fields inherited from class com.jniwrapper.Pointer |
---|
POINTER_LENGTH |
Fields inherited from class com.jniwrapper.Parameter |
---|
LICENSE_TYPE, V |
Constructor Summary | |
---|---|
ExternalArrayPointer(ArrayParameter array)
Constructs a new pointer to the given array. |
|
ExternalArrayPointer(ArrayParameter array,
boolean isNull)
Constructs a new pointer to the given array. |
Method Summary | |
---|---|
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. |
Methods inherited from class com.jniwrapper.Pointer |
---|
acceptIOPerformer, asTypedPointer, asVoidPointer, castTo, castTo, checkMemHandleLength, clone, equals, getDebugInfo, getLength, getParameterClass, getPointerHandle, isNull, pop, push, read, readPointer, setNull, setReferencedObject, setReferencedObject, write, writePointer, writeReferencedObject |
Methods inherited from class com.jniwrapper.Parameter |
---|
asReturnValue, dataBufferAssigned, getAlignedLength, getAlignmentRequirement, getDataBuffer, getDataBufferOffset, hashCode, indent, read, setDataBuffer, toByteArray |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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
.Method Detail |
---|
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |