4.4.1 Using the STRING Buffer Type
The STRING buffer type is an array of non-null characters that terminates with a null character. Unlike CARRAY, you can determine its transmission length by counting the number of characters in the buffer until reaching the null character. Since the STRING buffer is self-describing, the Oracle Tuxedo System can convert data automatically when data is exchanged by machines with different character sets.
Note:
During the data conversion from Jolt to STRING, the null terminator is automatically appended to the end of the STRING buffers because a Java string is not null-terminated.Using the STRING buffer type requires two main steps:
- Define the Tuxedo service that you will be using with the buffer type.
- Write the code that uses the STRING buffer type.
The next two sections provide examples that demonstrate these steps.
The ToUpper
code fragment shown in the listing “Use of the STRING Buffer Type (ToUpper.java)” illustrates how Jolt works with a service whose buffer type is STRING. The ToUpper
Oracle Tuxedo Service is available in the Oracle Tuxedo simpapp
example.