getByteArrayFromBO()

Serializes a business object into a byte array.

Syntax

abstract byte[] getByteArrayFromBO(BusinessObjectInterface theBusObj,
       Object config);
 

Parameters

theBusObj
Business object to be converted to a byte array.
config
Optional object containing additional configuration information for the data handler.

Return values

A byte array containing serialized data that represents the specified business object.

Exceptions

Exception
Thrown if the method cannot convert the business object to a byte array of serialized data.

Notes

The getByteArrayFromBO() method performs business-object-to-byte

conversion for a data handler. It converts the data in the theBusObj business object into a byte array (a Java byte[] object).

Important:
The getByteArrayFromBO() method is an abstract method that has no default implementation.Therefore, the data handler class must implement this method.

If you need to provide your data handler with more configuration information than is included in the meta-object, you can use the config option to pass in an object that contains this information. For example, config could be a template file or a string to a URL for a schema that is used to build an XML document from a business object.

If config is a business object type, you can implement the getByteArrayFromBO() method to call setupOptions(config). The setupOptions() method is defined in the DataHandler base class. This method uses the attribute names in the business object as property names and the default values as the values for those properties. It sets the values of the configuration properties in the object for use by the data handler.

See also

getBO() - public, getStreamFromBO(), getStringFromBO()

Copyright IBM Corp. 1997, 2003