class NativeString extends Object implements CharSequence, Comparable
const char* or const wchar_t*) for use when
converting a Java String into a native memory function argument.| Constructor and Description |
|---|
NativeString(String string)
Create a native string (NUL-terminated array of
char). |
NativeString(String string,
boolean wide)
Create a native string as a NUL-terminated array of
wchar_t
(if wide is true) or char. |
| Modifier and Type | Method and Description |
|---|---|
char |
charAt(int index) |
int |
compareTo(Object other) |
boolean |
equals(Object other) |
Pointer |
getPointer() |
int |
hashCode() |
int |
length() |
CharSequence |
subSequence(int start,
int end) |
String |
toString() |
public NativeString(String string)
char).
If the system property jna.encoding is set, its value will
be used to encode the native string. If not set or if the encoding
is unavailable, the default platform encoding will be used.
public NativeString(String string, boolean wide)
wchar_t
(if wide is true) or char.
If the system property jna.encoding is set, its value will
be used to encode the native charstring.
If not set or if the encoding is unavailable, the default platform
encoding will be used.
string - value to write to native memorywide - whether to store the String as wchar_tpublic String toString()
toString in interface CharSequencetoString in class Objectpublic Pointer getPointer()
public char charAt(int index)
charAt in interface CharSequencepublic int length()
length in interface CharSequencepublic CharSequence subSequence(int start, int end)
subSequence in interface CharSequencepublic int compareTo(Object other)
compareTo in interface Comparable