Package com.sun.jna
Class NativeString
java.lang.Object
com.sun.jna.NativeString
- All Implemented Interfaces:
- CharSequence,- Comparable
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.- Author:
- Todd Fast, todd.fast@sun.com, twall@users.sf.net
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionNativeString(WString string) Create a native string as a NUL-terminated array ofwchar_t.NativeString(String string) Create a native string (NUL-terminated array ofchar).NativeString(String string, boolean wide) Create a native string as a NUL-terminated array ofwchar_t(ifwideis true) orchar.NativeString(String string, String encoding) Create a native string (NUL-terminated array ofchar), using the requested encoding.
- 
Method SummaryModifier and TypeMethodDescriptioncharcharAt(int index) intbooleaninthashCode()intlength()subSequence(int start, int end) toString()Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequencechars, codePoints, isEmpty
- 
Field Details- 
WIDE_STRING- See Also:
 
 
- 
- 
Constructor Details- 
NativeStringCreate a native string (NUL-terminated array ofchar).Uses the encoding returned by Native.getDefaultStringEncoding().
- 
NativeStringCreate a native string as a NUL-terminated array ofwchar_t(ifwideis true) orchar.If not wide, the encoding is obtained fromNative.getDefaultStringEncoding().- Parameters:
- string- value to write to native memory
- wide- whether to store the String as- wchar_t
 
- 
NativeStringCreate a native string as a NUL-terminated array ofwchar_t.
- 
NativeStringCreate a native string (NUL-terminated array ofchar), using the requested encoding.
 
- 
- 
Method Details- 
hashCodepublic int hashCode()
- 
equals
- 
toString- Specified by:
- toStringin interface- CharSequence
- Overrides:
- toStringin class- Object
 
- 
getPointer
- 
charAtpublic char charAt(int index) - Specified by:
- charAtin interface- CharSequence
 
- 
lengthpublic int length()- Specified by:
- lengthin interface- CharSequence
 
- 
subSequence- Specified by:
- subSequencein interface- CharSequence
 
- 
compareTo- Specified by:
- compareToin interface- Comparable
 
 
-