public class JnaNativeHandle extends java.lang.Object implements INativeHandle
| Constructor and Description |
|---|
JnaNativeHandle(JnaNativeHandle handle,
int offset) |
JnaNativeHandle(long address) |
JnaNativeHandle(com.sun.jna.Pointer pointer) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
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. |
com.sun.jna.Pointer |
getPointer() |
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. |
int |
hashCode() |
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 handle)
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 pSize)
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. |
public JnaNativeHandle(JnaNativeHandle handle, int offset)
public JnaNativeHandle(long address)
public JnaNativeHandle(com.sun.jna.Pointer pointer)
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic long getAddress()
INativeHandlegetAddress in interface INativeHandlepublic byte getByte(int index)
INativeHandleindex from the start of the
memory chunk to a byte.getByte in interface INativeHandleindex - The byte offset from the start of the memory chunkpublic byte[] getByteArray(int index,
int count)
INativeHandleindex from the start of the
memory chunk to a byte array of length count.getByteArray in interface INativeHandleindex - The byte offset from the start of the memory chunkcount - The size of the byte arraypublic long getCLong(int index)
INativeHandleindex from the start of the
memory chunk to a long. Get only the "platform" number of bytes.getCLong in interface INativeHandleindex - The byte offset from the start of the memory chunkpublic int getInt(int index)
INativeHandleindex from the start of the
memory chunk to an int.getInt in interface INativeHandleindex - The byte offset from the start of the memory chunkpublic long getLong(int index)
INativeHandleindex from the start of the
memory chunk to a long value (which is always 8 byte).getLong in interface INativeHandleindex - The byte offset from the start of the memory chunkpublic INativeHandle getNativeHandle(int index)
INativeHandleindex from the start of the
memory chunk to an INativeHandle.getNativeHandle in interface INativeHandleindex - The byte offset from the start of the memory chunkINativeHandle marshaled from the memory chunkpublic com.sun.jna.Pointer getPointer()
public short getShort(int index)
INativeHandleindex from the start of the
memory chunk to a short.getShort in interface INativeHandleindex - The byte offset from the start of the memory chunkpublic int getSize()
INativeHandleYou can not access bytes from outside the range defined by getAdddress + size.
getSize in interface INativeHandlepublic java.lang.String getString(int index)
INativeHandleindex from the start of the
memory chunk to a String.getString in interface INativeHandleindex - The byte offset from the start of the memory chunkpublic java.lang.String getWideString(int index)
INativeHandleindex from the start of the
memory chunk to a String using the platform wide character conversion.getWideString in interface INativeHandleindex - The byte offset from the start of the memory chunkpublic int hashCode()
hashCode in class java.lang.Objectpublic INativeHandle offset(int offset)
INativeHandleINativeHandle, offset from this by
offset bytes.offset in interface INativeHandleoffset - The byte offset from the start of the memory chunkINativeHandle pointing to "getAddress() + offset".public void setByte(int index,
byte value)
INativeHandleindex from the
start of the memory chunk.setByte in interface INativeHandleindex - The byte offset from the start of the memory chunkvalue - The value to write.public void setByteArray(int index,
byte[] value,
int valueOffset,
int valueCount)
INativeHandleindex from
the start of the memory chunk. The method will write
valueCount bytes from value starting at
valueOffset.setByteArray in interface INativeHandleindex - The byte offset from the start of the memory chunkvalue - The value to write.public void setCLong(int index,
long value)
INativeHandleindex from the
start of the memory chunk. Write only the "platform" number of bytes. The
caller is responsible for observing the value range.setCLong in interface INativeHandleindex - The byte offset from the start of the memory chunkvalue - The value to write.public void setInt(int index,
int value)
INativeHandleindex from the
start of the memory chunk.setInt in interface INativeHandleindex - The byte offset from the start of the memory chunkvalue - The value to write.public void setLong(int index,
long value)
INativeHandleindex from the
start of the memory chunk.setLong in interface INativeHandleindex - The byte offset from the start of the memory chunkvalue - The value to write.public void setNativeHandle(int index,
INativeHandle handle)
INativeHandleINativeHandle to the memory at byte offset
index from the start of the memory chunk.setNativeHandle in interface INativeHandleindex - The byte offset from the start of the memory chunkpublic void setShort(int index,
short value)
INativeHandleindex from the
start of the memory chunk.setShort in interface INativeHandleindex - The byte offset from the start of the memory chunkvalue - The value to write.public void setSize(int pSize)
INativeHandlecount bytes.
You can not access bytes from outside the range defined by getAdddress + size.
setSize in interface INativeHandlepSize - The size of the memory managed by the INativeHandlepublic void setString(int index,
java.lang.String value)
INativeHandleindexfrom the
start of the memory chunk.setString in interface INativeHandleindex - The byte offset from the start of the memory chunkvalue - The value to write.public void setWideString(int index,
java.lang.String value)
INativeHandleindexfrom the
start of the memory chunk using the platform wide character conversion.setWideString in interface INativeHandleindex - The byte offset from the start of the memory chunkvalue - The value to write.