|
intarsys nativeC library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface INativeHandle
A "handle" to a piece of memory (in c space).
The handle combines an address and a memory chunk of a specified size.
Method Summary | |
---|---|
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. |
String |
getString(int index)
Marshal the data at byte offset index from the start of the
memory chunk to a String. |
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,
String value)
Write a String to the memory at byte offset index from the
start of the memory chunk. |
void |
setWideString(int index,
String value)
Write a String to the memory at byte offset index from the
start of the memory chunk using the platform wide character conversion. |
Method Detail |
---|
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 chunk
byte[] 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 array
long 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 chunk
int getInt(int index)
index
from the start of the
memory chunk to an int.
index
- The byte offset from the start of the memory chunk
long 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 chunk
INativeHandle getNativeHandle(int index)
index
from the start of the
memory chunk to an INativeHandle
.
index
- The byte offset from the start of the memory chunk
INativeHandle
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 chunk
int getSize()
You can not access bytes from outside the range defined by getAdddress + size.
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 chunk
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 chunk
INativeHandle offset(int offset)
INativeHandle
, offset from this by
offset
bytes.
offset
- The byte offset from the start of the memory chunk
INativeHandle
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 INativeHandle
void setString(int index, String 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 setWideString(int index, String value)
index
from 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.
|
intarsys nativeC library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |