Package com.sun.jna

Klasse NativeString

java.lang.Object
com.sun.jna.NativeString
Alle implementierten Schnittstellen:
CharSequence, Comparable

class NativeString extends Object implements 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.
Autor:
Todd Fast, todd.fast@sun.com, twall@users.sf.net
  • Felddetails

  • Konstruktordetails

    • NativeString

      public NativeString(String string)
      Create a native string (NUL-terminated array of char).

      Uses the encoding returned by Native.getDefaultStringEncoding().

    • NativeString

      public NativeString(String string, boolean wide)
      Create a native string as a NUL-terminated array of wchar_t (if wide is true) or char.

      If not wide, the encoding is obtained from Native.getDefaultStringEncoding().

      Parameter:
      string - value to write to native memory
      wide - whether to store the String as wchar_t
    • NativeString

      public NativeString(WString string)
      Create a native string as a NUL-terminated array of wchar_t.
    • NativeString

      public NativeString(String string, String encoding)
      Create a native string (NUL-terminated array of char), using the requested encoding.
  • Methodendetails