Site Tools


Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:7.5.8_arraylength

7.5.8 arraylength

Get length of array

Format

arraylength

Forms

arraylength = 146 (0x92)

Stack

…, arrayref → …, length

Description

The arrayref must be of type reference and must refer to an array. It is popped from the operand stack. The length of the array it references is determined. That length is pushed onto the top of the operand stack as a short.

Runtime Exception

If arrayref is null, the arraylength instruction throws a NullPointerException.

Notes

In some circumstances, the arraylength instruction may throw a SecurityException if the current context ( Section 3.4, Contexts) is not the owning context ( Section 3.4, Contexts) of the array referenced by arrayref. The exact circumstances when the exception will be thrown are specified in Chapter 6 of the Runtime Environment Specification, Java Card Platform, Version 2.2.2.

javacard/jcvm/7.5.8_arraylength.txt · Last modified: 2017/05/13 04:10 (external edit)