Built-In Namespace Array
Method Attributes | Method Name and Description |
---|---|
toJava(type)
Converts a JavaScript Array object into a Java array of the named type.
|
Method Detail
toJava(type)
Converts a JavaScript Array object into a Java array of the named type.
This routine converts a JavaScript Array into a particular type of Java array. For example,
this is the only way to create a byte[] array commonly used for e.g. IP addresses.
Defined in: utils.js.
Example:
var JSArray = [ 012, 000, 000, 0147 ]; var JavaArray = JSArray.toJava(Byte); var hostname = java.net.InetAddress.getByAddress(JavaArray);
Defined in: utils.js.
- Parameters:
- {Object[]} type
- The type of Java array to create