*            The maximum number of elements to copy.
     * 
     * @return The number of elements actually copied, or -1 if the
     *         <code>Value</code> object represents <code>null</code>.
     */
    public int getBooleanArray(boolean[] array, int fromOffset, int toOffset, int length) {
        _serializedItemCount++;
        if (nextType(CLASS_ARRAY) == TYPE_NULL)
            return -1;
        try {
            _depth++;
            nextType(TYPE_BOOLEAN);
            int sourceLength = _end - _next;
            if (length > sourceLength - fromOffset)
                length = sourceLength - fromOffset;
            if (length > array.length - toOffset)
                length = array.length - toOffset;
            for (int index = 0; index < length; index++) {
                array[toOffset + index] = toBoolean(index + fromOffset);
            }
            closeVariableLengthItem();
            return length;
        } finally {
            _depth--;
        }
    }