Microsoft SDK for Java

setByte

The setByte method of the SafeArray Class contains the following signatures:

setByte(int idx, byte val)
setByte(int idx1, int idx2, byte val)

setByte(int idx, byte val)

Sets an element of a one-dimensional SafeArray.

Syntax

public void setByte(int idx, byte val);

Parameters

idx The index of the element to set, which ranges from the lower bound to the upper bound of the SafeArray.
val The new element value.

Exceptions

IndexOutOfBoundsException if the array is not one-dimensional or if idx does not lie between the lower bound and the upper bound of the SafeArray (inclusive).

ClassCastException if the Java value cannot be converted to the SafeArray element type by using the Win32 VariantChangeType function.

setByte(int idx1, int idx2, byte val)

Sets an element of a two-dimensional SafeArray.

Syntax

public void setByte(int idx1, int idx2, byte val);

Parameters

idx1 The first dimension index of the element to set, which ranges from LBound(1) to UBound(1).
idx2 The second dimension index of the element to set, which ranges from LBound(2) to UBound(2).
val The new element value.

Exceptions

IndexOutOfBoundsException if the array is not two-dimensional or if either index lies outside the defined range.

ClassCastException if the Java value cannot be converted to the SafeArray element type by using the Win32 VariantChangeType function.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.