public interface INativeHandle
The handle combines an address and a memory chunk of a specified size.
| Modifier and Type | Method and Description |
|---|---|
long |
getAddress()
The start address of the memory chunk
|
byte |
getByte(int index)
Marshal the data at byte offset
index from the start of the
memory chunk to a byte. |
byte[] |
getByteArray(int index,
int count)
Marshal the data at byte offset
index from the start of the
memory chunk to a byte array of length count. |
long |
getCLong(int index)
Marshal the data at byte offset
index from the start of the
memory chunk to a long. |
int |
getInt(int index)
Marshal the data at byte offset
index from the start of the
memory chunk to an int. |
long |
getLong(int index)
Marshal the data at byte offset
index from the start of the
memory chunk to a long value (which is always 8 byte). |
INativeHandle |
getNativeHandle(int index)
Marshal the data at byte offset
index from the start of the
memory chunk to an INativeHandle. |
short |
getShort(int index)
Marshal the data at byte offset
index from the start of the
memory chunk to a short. |
int |
getSize()
The size for the handle in bytes.
|
java.lang.String |
getString(int index)
Marshal the data at byte offset
index from the start of the
memory chunk to a String. |
java.lang.String |
getWideString(int index)
Marshal the data at byte offset
index from the start of the
memory chunk to a String using the platform wide character conversion. |
INativeHandle |
offset(int offset)
Create a new
INativeHandle, offset from this by
offset bytes. |
void |
setByte(int index,
byte value)
Write a byte to the memory at byte offset
index from the
start of the memory chunk. |
void |
setByteArray(int index,
byte[] value,
int valueOffset,
int valueCount)
Write a byte array to the memory at byte offset
index from
the start of the memory chunk. |
void |
setCLong(int index,
long value)
Write a long to the memory at byte offset
index from the
start of the memory chunk. |
void |
setInt(int index,
int value)
Write an int to the memory at byte offset
index from the
start of the memory chunk. |
void |
setLong(int index,
long value)
Write a long to the memory at byte offset
index from the
start of the memory chunk. |
void |
setNativeHandle(int index,
INativeHandle valueHandle)
Write an
INativeHandle to the memory at byte offset
index from the start of the memory chunk. |
void |
setShort(int index,
short value)
Write a short to the memory at byte offset
index from the
start of the memory chunk. |
void |
setSize(int count)
Set the valid size for the handle to
count bytes. |
void |
setString(int index,
java.lang.String value)
Write a String to the memory at byte offset
indexfrom the
start of the memory chunk. |
void |
setWideString(int index,
java.lang.String value)
Write a String to the memory at byte offset
indexfrom the
start of the memory chunk using the platform wide character conversion. |
long getAddress()
byte getByte(int index)
index from the start of the
memory chunk to a byte.index - The byte offset from the start of the memory chunkbyte[] getByteArray(int index,
int count)
index from the start of the
memory chunk to a byte array of length count.index - The byte offset from the start of the memory chunkcount - The size of the byte arraylong getCLong(int index)
index from the start of the
memory chunk to a long. Get only the "platform" number of bytes.index - The byte offset from the start of the memory chunkint getInt(int index)
index from the start of the
memory chunk to an int.index - The byte offset from the start of the memory chunklong getLong(int index)
index from the start of the
memory chunk to a long value (which is always 8 byte).index - The byte offset from the start of the memory chunkINativeHandle getNativeHandle(int index)
index from the start of the
memory chunk to an INativeHandle.index - The byte offset from the start of the memory chunkINativeHandle marshaled from the memory chunkshort getShort(int index)
index from the start of the
memory chunk to a short.index - The byte offset from the start of the memory chunkint getSize()
You can not access bytes from outside the range defined by getAdddress + size.
java.lang.String getString(int index)
index from the start of the
memory chunk to a String.index - The byte offset from the start of the memory chunkjava.lang.String getWideString(int index)
index from the start of the
memory chunk to a String using the platform wide character conversion.index - The byte offset from the start of the memory chunkINativeHandle offset(int offset)
INativeHandle, offset from this by
offset bytes.offset - The byte offset from the start of the memory chunkINativeHandle pointing to "getAddress() + offset".void setByte(int index,
byte value)
index from the
start of the memory chunk.index - The byte offset from the start of the memory chunkvalue - The value to write.void setByteArray(int index,
byte[] value,
int valueOffset,
int valueCount)
index from
the start of the memory chunk. The method will write
valueCount bytes from value starting at
valueOffset.index - The byte offset from the start of the memory chunkvalue - The value to write.void setCLong(int index,
long value)
index from the
start of the memory chunk. Write only the "platform" number of bytes. The
caller is responsible for observing the value range.index - The byte offset from the start of the memory chunkvalue - The value to write.void setInt(int index,
int value)
index from the
start of the memory chunk.index - The byte offset from the start of the memory chunkvalue - The value to write.void setLong(int index,
long value)
index from the
start of the memory chunk.index - The byte offset from the start of the memory chunkvalue - The value to write.void setNativeHandle(int index,
INativeHandle valueHandle)
INativeHandle to the memory at byte offset
index from the start of the memory chunk.index - The byte offset from the start of the memory chunkvalue - The value to write.void setShort(int index,
short value)
index from the
start of the memory chunk.index - The byte offset from the start of the memory chunkvalue - The value to write.void setSize(int count)
count bytes.
You can not access bytes from outside the range defined by getAdddress + size.
count - The size of the memory managed by the INativeHandlevoid setString(int index,
java.lang.String value)
indexfrom the
start of the memory chunk.index - The byte offset from the start of the memory chunkvalue - The value to write.void setWideString(int index,
java.lang.String value)
indexfrom the
start of the memory chunk using the platform wide character conversion.index - The byte offset from the start of the memory chunkvalue - The value to write.