JiGlue Java - COM Data Types

This topic describes the Java™ - COM data type conversions between primitive and reference Java data types and COM data types supported by the JiGlue COM Bridge.

Topics include:

JiGlue COM Bridge Java-to-COM Data Type Conversions

The JiGlue COM Bridge supports the following Java to COM data type conversions:

Reference (non-primitive) Java data types, such as one-dimensional and multi-dimensional arrays and other Java objects, are also supported (see JiGlue COM Bridge Programming Guidelines below).

Caution If you are coding in Visual Basic®, remember that in VB an integer (int) is a 16-bit value, whereas in Java, int is a 32-bit two's complement value; for details, see JiGlue COM Bridge Programming Guidelines below.

Java Data Type COM Data Type
Data Type
Description Size/Structure
Data Type (VT_)

boolean (java.lang.Boolean)

Boolean value true or false

Boolean (VT_I1)

char (java.lang.Char) A single character 16-bit single Unicode character
2-byte unsigned (VT_UI2)
short (java.lang.Short) Short integer 16-bit two's complement
2-byte signed integer (VT_I2)

int (java.lang.Integer)

Integer 32-bit two's complement

4-byte signed integer (VT_I4)

long (java.lang.Long) Long integer 64-bit two's complement
4-byte signed integer (VT_I4)*

float (java.lang.Float)

Single-precision floating point 32-bit IEEE 754

Float (VT_R4)

double (java.lang.Double) Double-precision floating point 64-bit IEEE 754
Double (VT_R8)

java.lang.String

Text string. String

BSTR (VT_BSTR)

java.util.Date Date Date
Date (VT_DATE)

Other Java object

Reference Reference

IDispatch (VT_DISPATCH)

*Conversion of a Java Long integer (long) to a COM 4-byte signed integer (VT_I4) may result in a loss of precision, due to the conversion from a 64-bit value to a 32-bit value.

JiGlue COM Bridge Programming Guidelines

The following guidelines should be kept in mind when coding an application using the JiGlue COM Bridge: