| java.lang.Object org.apache.harmony.awt.nativebridge.VoidPointer org.apache.harmony.awt.nativebridge.Int8Pointer
Int8Pointer | public class Int8Pointer extends VoidPointer (Code) | | This class represents pointer to memory for working with native functions.
It is an analogue of char* C type. Every pointed object can be direct
native object or Java object. In both cases NativeBridge provides correct
passing addresses to native functions, native address is passed as is, Java
object will be implicitly locked and address of lock will be passed to native.
NULL pointer can't be wrapped by this object, NULL is represents by Java
null value.
|
Method Summary | |
public void | fill(byte value, int size) | public byte | get(int index) Returns the element at the specified position. | public void | get(byte[] dst, int from, int length) This method transfers bytes into the given destination array. | public Int8Pointer | getElementPointer(int index) Returns class that represents the pointer to specified index. | public String | getStringUTF() Creates String from 0 terminated modified UTF8 string. | public String | getStringUTF(long strlen) Creates String from 0 terminated modified UTF8 native string of max
strlen length in bytes. | public void | set(byte[] src, int offset, int length) This method transfers bytes from the given destination array. | public void | set(int index, byte value) Sets the element at the specified position. | public void | setStringUTF(String str) Convert String to 0 terminated UTF8 (Unicode) string. | public int | size() |
Int8Pointer | Int8Pointer(int size, boolean direct)(Code) | | |
Int8Pointer | Int8Pointer(byte[] arr, int offset, int size)(Code) | | |
Int8Pointer | Int8Pointer(long addr)(Code) | | |
fill | public void fill(byte value, int size)(Code) | | |
get | public void get(byte[] dst, int from, int length)(Code) | | This method transfers bytes into the given destination array.
Parameters: dst - - The array into which bytes are to be written Parameters: from - - Initial offset in the destination array.Must be non-negative and no larger than dst.length Parameters: length - - The maximum number of bytes to be written to the given array;must be non-negative and no larger than dst.length - from throws: IndexOutOfBoundsException - if from < 0 || from > dst.length throws: IndexOutOfBoundsException - if length < 0 || length > dst.length - from throws: IndexOutOfBoundsException - if length > this.size() |
getElementPointer | public Int8Pointer getElementPointer(int index)(Code) | | Returns class that represents the pointer to specified index.
Parameters: index - - index from which pointer is returned throws: IndexOutOfBoundsException - if index is out of range |
getStringUTF | public String getStringUTF()(Code) | | Creates String from 0 terminated modified UTF8 string.
|
getStringUTF | public String getStringUTF(long strlen)(Code) | | Creates String from 0 terminated modified UTF8 native string of max
strlen length in bytes.
|
set | public void set(byte[] src, int offset, int length)(Code) | | This method transfers bytes from the given destination array.
Parameters: src - - The array from which bytes are to be read Parameters: offset - - The offset within the array of the first byte to be read;must be non-negative and no larger than dst.length Parameters: length - - The maximum number of bytes to be read from the given array;must be non-negative and no larger than array.length - offset throws: IndexOutOfBoundsException - if from < 0 || from > src.length throws: IndexOutOfBoundsException - if length < 0 || length > src.length - from throws: IndexOutOfBoundsException - if length > this.size() |
setStringUTF | public void setStringUTF(String str)(Code) | | Convert String to 0 terminated UTF8 (Unicode) string.
And set it to buffer
|
|
|