Value.toByte

Overview | Methods | This Package | All Packages

Value.toByte

Converts an object to a byte value.

Syntax

public static byte toByte( Object value )

Parameters

value

The value to convert.

Return Value

Returns a byte value that represents the object.

Exceptions

ClassCastException thrown if the argument cannot be converted.

Remarks

The following table lists the supported argument types and the resulting conversion.

Type Conversion
null Returns 0.
Character Returns the low-order byte of the character stored in the object. Produced by calling Character.charValue.
Number Returns the byte value of the object. Produced by calling Number.byteValue.
String Returns the result of converting the numeric string to a byte value. Produced by calling Byte.parseByte.
Variant Returns the result of coercing the variant to a byte value. Produced by calling Variant.toByte.

See Also    toObject