*             array.
     */
    public int getArrayLength() {
        int start = _next;
        int type = nextType(CLASS_ARRAY, CLASS_MULTI_ARRAY);
        if (type == TYPE_NULL)
            return -1;
        int componentClassHandle = -1;
        int result = -1;
        try {
            _depth++;
            componentClassHandle = nextType();
            if (type == CLASS_MULTI_ARRAY)
                _next++; // skip the dimension count.
            int length = _end - _next;
            if (type == CLASS_ARRAY && componentClassHandle > 0 && componentClassHandle <= TYPE_DOUBLE
                    && FIXED_ENCODING_SIZES[componentClassHandle] > 0) {
                result = length / FIXED_ENCODING_SIZES[componentClassHandle];
            } else {
                result = decodeElementCount();
            }
        } finally {
            closeVariableLengthItem();
            _depth--;
            _next = start;
        }
        return result;
    }