|
JNA API> 4.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jna.NativeString
class NativeString
Provides a temporary allocation of an immutable C string
(const char*
or const wchar_t*
) for use when
converting a Java String into a native memory function argument.
Field Summary | |
---|---|
(package private) static String |
WIDE_STRING
|
Constructor Summary | |
---|---|
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 . |
|
NativeString(String string,
String encoding)
Create a native string (NUL-terminated array of char ),
using the requested encoding. |
|
NativeString(WString string)
Create a native string as a NUL-terminated array of wchar_t . |
Method Summary | |
---|---|
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()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
static final String WIDE_STRING
Constructor Detail |
---|
public NativeString(String string)
char
).
Uses the encoding returned by Native.getDefaultStringEncoding()
.
public NativeString(String string, boolean wide)
wchar_t
(if wide
is true) or char
.
If not wide
, the encoding is obtained from Native.getDefaultStringEncoding()
.
string
- value to write to native memorywide
- whether to store the String as wchar_t
public NativeString(WString string)
wchar_t
.
public NativeString(String string, String encoding)
char
),
using the requested encoding.
Method Detail |
---|
public int hashCode()
hashCode
in class Object
public boolean equals(Object other)
equals
in class Object
public String toString()
toString
in interface CharSequence
toString
in class Object
public Pointer getPointer()
public char charAt(int index)
charAt
in interface CharSequence
public int length()
length
in interface CharSequence
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
public int compareTo(Object other)
compareTo
in interface Comparable
|
JNA API> 4.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |