Top Description Fields Constructors Methods
com.sun.jna

public Class StringArray

extends Memory
implements PostCallRead
Class Inheritance
All Implemented Interfaces
com.sun.jna.Function.PostCallRead
Imports
java.util.ArrayList, .Arrays, .List

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

Modifier and TypeField and Description
private String
private List<NativeString>
private Object[]
Inherited from com.sun.jna.Memory:
size

Constructor Summary

AccessConstructor and Description
public
StringArray(String[] strings)

Create a native array of strings.

public
StringArray(String[] strings, boolean wide)

Create a native array of strings.

public
StringArray(String[] strings, String encoding)

Create a native array of strings using the given encoding.

public
StringArray(WString[] strings)

Create a native array of wide strings.

private
StringArray(Object[] strings, String encoding)

Method Summary

Modifier and TypeMethod and Description
public void
read()

Implements com.sun.jna.Function.PostCallRead.read.

Read back from native memory.
public String
toString()

Overrides com.sun.jna.Memory.toString.

Returns a string representation of the object.
Inherited from com.sun.jna.Memory:
alignboundsCheckclearclosedisposedisposeAlldumpfreegetBytegetByteBuffergetChargetDoublegetFloatgetIntgetLonggetPointergetShortgetStringgetWideStringmallocpurgereadreadreadreadreadreadreadreadsetBytesetCharsetDoublesetFloatsetIntsetLongsetPointersetShortsetStringsetWideStringsharesharesizevalidwritewritewritewritewritewritewritewrite

Field Detail

encodingback to summary
private String encoding
nativesback to summary
private List<NativeString> natives
originalback to summary
private Object[] original

Constructor Detail

StringArrayback to summary
public StringArray(String[] strings)

Create a native array of strings.

StringArrayback to summary
public StringArray(String[] strings, boolean wide)

Create a native array of strings.

StringArrayback to summary
public StringArray(String[] strings, String encoding)

Create a native array of strings using the given encoding.

StringArrayback to summary
public StringArray(WString[] strings)

Create a native array of wide strings.

StringArrayback to summary
private StringArray(Object[] strings, String encoding)

Method Detail

readback to summary
public void read()

Implements com.sun.jna.Function.PostCallRead.read.

Read back from native memory.

Annotations
@Override
toStringback to summary
public String toString()

Overrides com.sun.jna.Memory.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override