JvmArrays extension

Array creation and access.

on

Methods

arrayLength(JavaRef array) → int

Available on Jvm, provided by the JvmArrays extension

The length of any Java array.
arrayToList(JavaRef array, String elementDescriptor, {int start = 0, int? length}) → List<Object?>

Available on Jvm, provided by the JvmArrays extension

Reads a whole array into Dart, choosing the natural list type for elementDescriptor.
elementClass(String elementDescriptor) → JavaRef

Available on Jvm, provided by the JvmArrays extension

The jclass for an array's element type.
getArrayElement(JavaRef array, String elementDescriptor, int index) → Object?

Available on Jvm, provided by the JvmArrays extension

Reads one element, as the natural Dart type for elementDescriptor.
getBooleanArray(JavaRef array, {int start = 0, int? length}) → List<bool>

Available on Jvm, provided by the JvmArrays extension

Reads a boolean[] as a list of Dart bools.
getByteArray(JavaRef array, {int start = 0, int? length}) → Int8List

Available on Jvm, provided by the JvmArrays extension

Reads a byte[]. Java bytes are signed, so this is an Int8List.
getCharArray(JavaRef array, {int start = 0, int? length}) → Uint16List

Available on Jvm, provided by the JvmArrays extension

Reads a char[] as UTF-16 code units.
getDoubleArray(JavaRef array, {int start = 0, int? length}) → Float64List

Available on Jvm, provided by the JvmArrays extension

getFloatArray(JavaRef array, {int start = 0, int? length}) → Float32List

Available on Jvm, provided by the JvmArrays extension

getIntArray(JavaRef array, {int start = 0, int? length}) → Int32List

Available on Jvm, provided by the JvmArrays extension

getLongArray(JavaRef array, {int start = 0, int? length}) → Int64List

Available on Jvm, provided by the JvmArrays extension

getObjectArray(JavaRef array, {int start = 0, int? length}) → List<JavaRef>

Available on Jvm, provided by the JvmArrays extension

An object array's elements as fresh local references.
getObjectArrayElement(JavaRef array, int index) → JavaRef

Available on Jvm, provided by the JvmArrays extension

Reads one element of an object array.
getShortArray(JavaRef array, {int start = 0, int? length}) → Int16List

Available on Jvm, provided by the JvmArrays extension

getStringArray(JavaRef array, {int start = 0, int? length}) → List<String?>

Available on Jvm, provided by the JvmArrays extension

A String[] as Dart strings, preserving null elements.
getUnsignedByteArray(JavaRef array, {int start = 0, int? length}) → Uint8List

Available on Jvm, provided by the JvmArrays extension

Reads a byte[] as unsigned bytes.
newArray(String elementDescriptor, List<Object?> values) → JavaRef

Available on Jvm, provided by the JvmArrays extension

Creates a Java array of elementDescriptor elements holding values.
newBooleanArray(int length) → JavaRef

Available on Jvm, provided by the JvmArrays extension

newByteArray(int length) → JavaRef

Available on Jvm, provided by the JvmArrays extension

newCharArray(int length) → JavaRef

Available on Jvm, provided by the JvmArrays extension

newDoubleArray(int length) → JavaRef

Available on Jvm, provided by the JvmArrays extension

newFloatArray(int length) → JavaRef

Available on Jvm, provided by the JvmArrays extension

newIntArray(int length) → JavaRef

Available on Jvm, provided by the JvmArrays extension

newLongArray(int length) → JavaRef

Available on Jvm, provided by the JvmArrays extension

newObjectArray(int length, JavaRef elementClass, [JavaRef? initialElement]) → JavaRef

Available on Jvm, provided by the JvmArrays extension

Creates a elementClass[length], every slot initialised to initialElement (Java null when omitted).
newPrimitiveArray(String descriptor, int length) → JavaRef

Available on Jvm, provided by the JvmArrays extension

Creates a primitive array whose element type is given by descriptor (one of Z B C S I J F D).
newShortArray(int length) → JavaRef

Available on Jvm, provided by the JvmArrays extension

setArrayElement(JavaRef array, String elementDescriptor, int index, Object? value) → void

Available on Jvm, provided by the JvmArrays extension

Writes one element, converting value for elementDescriptor.
setBooleanArray(JavaRef array, List<bool> values, {int start = 0}) → void

Available on Jvm, provided by the JvmArrays extension

setByteArray(JavaRef array, List<int> values, {int start = 0}) → void

Available on Jvm, provided by the JvmArrays extension

setCharArray(JavaRef array, List<int> values, {int start = 0}) → void

Available on Jvm, provided by the JvmArrays extension

setDoubleArray(JavaRef array, List<double> values, {int start = 0}) → void

Available on Jvm, provided by the JvmArrays extension

setFloatArray(JavaRef array, List<double> values, {int start = 0}) → void

Available on Jvm, provided by the JvmArrays extension

setIntArray(JavaRef array, List<int> values, {int start = 0}) → void

Available on Jvm, provided by the JvmArrays extension

setLongArray(JavaRef array, List<int> values, {int start = 0}) → void

Available on Jvm, provided by the JvmArrays extension

setObjectArrayElement(JavaRef array, int index, JavaRef? value) → void

Available on Jvm, provided by the JvmArrays extension

Writes one element of an object array. value may be null.
setShortArray(JavaRef array, List<int> values, {int start = 0}) → void

Available on Jvm, provided by the JvmArrays extension