public class NativeBuffer extends BaseNativeType
| Modifier and Type | Field and Description |
|---|---|
protected memptr |
value
The stored value.
|
copyIn, copyOut, passByPointer, ptr, ref, type| Constructor and Description |
|---|
NativeBuffer()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
memptr |
getValue()
Access the data element.
|
void |
readExternal(java.io.ObjectInput in)
Replacement for the default object reading method.
|
long |
render(long addr)
Render the data's address into native memory if an explicit address is provided and
return the data's address to the caller.
|
void |
restore(long addr)
Copy back (if necessary) data from the native memory, if given.
|
void |
setValue(memptr value)
Assign the data element.
|
int |
size()
Report the size (in bytes) of the native memory needed to store this instance.
|
void |
writeExternal(java.io.ObjectOutput out)
Replacement for the default object writing method.
|
isCopyIn, isCopyOut, isPassByPointer, render, restore, setCopyIn, setCopyOut, setPassByPointer, setType, typeprotected memptr value
public memptr getValue()
public void setValue(memptr value)
value - The buffer.public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.ExternalizablereadExternal in class BaseNativeTypein - The input source from which fields will be restored.java.io.IOException - In case of I/O errors.java.lang.ClassNotFoundException - If payload can't be instantiated.public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.ExternalizablewriteExternal in class BaseNativeTypeout - The output destination to which fields will be saved.java.io.IOException - In case of I/O errors.public int size()
This should never be called on the server, only on the client side.
size in class BaseNativeTypepublic long render(long addr)
This should never be called on the server, only on the client side.
render in class BaseNativeTypeaddr - The memory address to which the data should be rendered, if the caller
is supplying a buffer or 0 if the target address should be returned
directly (without further allocation or writing the address to any
buffer).public void restore(long addr)
This should never be called on the server, only on the client side.
restore in class BaseNativeTypeaddr - The memory address from which the data should be restored, if the caller
is supplying a buffer or 0 if there is no data to copy back.