com.jniwrapper
Class ExternalArrayPointer

java.lang.Object
  |
  +--com.jniwrapper.Parameter
        |
        +--com.jniwrapper.Pointer
              |
              +--com.jniwrapper.ExternalArrayPointer

public class ExternalArrayPointer
extends Pointer

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 passed array is correctly reallocated by the caller use ResizingPointer instead of this class.

Since:
1.1

Nested Class Summary
 
Nested classes inherited from class com.jniwrapper.Pointer
Pointer.Const, Pointer.OutOnly, Pointer.Void
 
Field Summary
 
Fields inherited from class com.jniwrapper.Pointer
POINTER_LENGTH
 
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
 void read(DataBuffer stackBuffer, int offset, boolean invokedByCallback)
          Reads this parameter from a specified data source.
 void readArray(int count)
          Reads the resized array.
 void write(DataBuffer stackBuffer, int offset, boolean invokedByCallback)
          Writes this parameter to a specified data source.
 
Methods inherited from class com.jniwrapper.Pointer
acceptIOPerformer, asVoidPointer, checkMemHandleLength, clone, getLength, getPointerHandle, getReferencedObject, isNull, pop, push, read, readPointer, readReferencedObject, setExternalSource, setNull, setReferencedObject, setReferencedObject, toString, write, writePointer, writeReferencedObject
 
Methods inherited from class com.jniwrapper.Parameter
asReturnValue, equals, getAlignedLength, getAlignmentRequirement, getDataBuffer, getDataBufferOffset, indent, setDataBuffer, toByteArray
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExternalArrayPointer

public ExternalArrayPointer(ArrayParameter array)
Constructs a new pointer to the given array.


ExternalArrayPointer

public ExternalArrayPointer(ArrayParameter array,
                            boolean isNull)
Constructs a new pointer to the given array.

Parameters:
array -
isNull - the pointer passed to the function will be initially null if this parameter is true true.
Method Detail

write

public void write(DataBuffer stackBuffer,
                  int offset,
                  boolean invokedByCallback)
           throws MemoryAccessViolationException
Description copied from class: Parameter
Writes this parameter to a specified data source.

Overrides:
write in class Pointer
MemoryAccessViolationException

read

public void read(DataBuffer stackBuffer,
                 int offset,
                 boolean invokedByCallback)
          throws MemoryAccessViolationException
Description copied from class: Parameter
Reads this parameter from a specified data source.

Overrides:
read in class Pointer
MemoryAccessViolationException

readArray

public void readArray(int count)
Reads the resized array.

Parameters:
count - new element count.