StringArray (JNA API)

com.sun.jna

## Class StringArray

- java.lang.Object
- - com.sun.jna.Pointer
  - - com.sun.jna.Memory
    - - com.sun.jna.StringArray

- All Implemented Interfaces:
    Function.PostCallRead

      public class StringArray
      extends Memory
      implements Function.PostCallRead

  Handle native array of `char*` or `wchar_t*` type by managing allocation/disposal of native strings within an array of pointers. An extra NULL pointer is always added to the end of the native pointer array for convenience.

- - ### Field Summary

    - ### Fields inherited from class com.sun.jna.Memory

      `size`

    - ### Fields inherited from class com.sun.jna.Pointer

      `NULL, peer, SIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StringArray(java.lang.String[] strings)` Create a native array of strings.
    `StringArray(java.lang.String[] strings, boolean wide)` Create a native array of strings.
    `StringArray(java.lang.String[] strings, java.lang.String encoding)` Create a native array of strings using the given encoding.
    `StringArray(WString[] strings)` Create a native array of wide strings.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `read()` Read back from native memory.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class com.sun.jna.Memory

      `align, boundsCheck, clear, dispose, disposeAll, dump, finalize, free, getByte, getByteBuffer, getChar, getDouble, getFloat, getInt, getLong, getPointer, getShort, getString, getWideString, malloc, purge, read, read, read, read, read, read, read, setByte, setChar, setDouble, setFloat, setInt, setLong, setPointer, setShort, setString, setWideString, share, share, size, valid, write, write, write, write, write, write, write`

    - ### Methods inherited from class com.sun.jna.Pointer

      `clear, createConstant, createConstant, dump, equals, getByteArray, getCharArray, getDoubleArray, getFloatArray, getIntArray, getLongArray, getNativeLong, getPointerArray, getPointerArray, getShortArray, getString, getString, getStringArray, getStringArray, getStringArray, getStringArray, getStringArray, getStringArray, getValue, getWideStringArray, getWideStringArray, hashCode, indexOf, nativeValue, nativeValue, read, setMemory, setNativeLong, setString, setString, setString, setValue, write`

    - ### Methods inherited from class java.lang.Object

      `clone, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### StringArray

          public StringArray(java.lang.String[] strings)

      Create a native array of strings.

    - #### StringArray

          public StringArray(java.lang.String[] strings,
                             boolean wide)

      Create a native array of strings.

    - #### StringArray

          public StringArray(java.lang.String[] strings,
                             java.lang.String encoding)

      Create a native array of strings using the given encoding.

    - #### StringArray

          public StringArray(WString[] strings)

      Create a native array of wide strings.

  - ### Method Detail

    - #### read

          public void read()

      Read back from native memory.
      Specified by:
        `read` in interface `Function.PostCallRead`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `Memory`

Copyright © 2007-2016 Timothy Wall. All Rights Reserved.