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 char
string.
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_t
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in class java.lang.Object
public Pointer getPointer()
public char charAt(int index)
charAt
in interface java.lang.CharSequence
public int length()
length
in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable