If the di1 data item exists, then the first bit in the bitmap needs to be set. If the di1Exists flag is set then the intPBitmap is set to 128. The integer value 128 when converted to bytes is 10000000. If the di1 and di2 data items exist, then the first bit and the second bit in the bitmap need to be set. The integer value when converted to bytes is 11000000.
Similar code exists for every single data item required.
This article sheds light on how a message can be built for a Java application to communicate with a legacy system. This document illustrates methods to construct bitmaps dynamically, depending on the input data. Similar ideas are used to interpret messages sent to a Java application by the legacy system. In the interests of keeping this article brief, those details are left for the reader to research separately. About the Author Sharath Sahadevan is a senior software engineer with MasterCard International in St. Louis.