class NativeString
extends java.lang.Object
implements java.lang.CharSequence, java.lang.Comparable
const char* or const wchar_t*) for use when
converting a Java String into a native memory function argument.| Constructor and Description |
|---|
NativeString(java.lang.String string)
Create a native string (NUL-terminated array of
char). |
NativeString(java.lang.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(java.lang.Object other) |
boolean |
equals(java.lang.Object other) |
Pointer |
getPointer() |
int |
hashCode() |
int |
length() |
java.lang.CharSequence |
subSequence(int start,
int end) |
java.lang.String |
toString() |
public NativeString(java.lang.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(java.lang.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 int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in interface java.lang.CharSequencetoString in class java.lang.Objectpublic Pointer getPointer()
public char charAt(int index)
charAt in interface java.lang.CharSequencepublic int length()
length in interface java.lang.CharSequencepublic java.lang.CharSequence subSequence(int start,
int end)
subSequence in interface java.lang.CharSequencepublic int compareTo(java.lang.Object other)
compareTo in interface java.lang.Comparable