Implementing Data Code

The image data itself is encapsulated in its own CORBA server object so that it can be translated between Java and CORBA data types. The sams.corba.IDLImage class encap sulates image data and breaks it into three parts: a sequence of 32-bit integers representing the image pixels, a 32-bit integer representing the image height, and a 32-bit integer representing the image width.

The implementation of the sams.corba.IDLImage class is shown in Listing 19.2. The collection of pixels is assigned to the imageData variable. The height of the image is assigned to the height variable and the width of the image is assigned to the width variable. These three properties are the key to the class's ability to communicate an image through ...

Get JavaBeans Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.