When B4A converts to native Java it wraps CHAR in a function called Object to Char, B4A source for that below:
public static char ObjectToChar(Object o) {
if (o instanceof Character)
return ((Character)o).charValue();
else
return CharFromString(o.toString());
}
public static char CharFromString(String s) {
if (s == null || s.length() == 0)
return '\0';
else
return s.charAt(0);
}
As you can see, it converts whatever you send to a string, then returns the value at position 0.
So - when I was doing CHAR(11) - in the end the data sent to the system I'm integrating with only got "1".
The sample code, in Java, using the same CHAR(11) works fine. My understanding is that in Java a CHAR is a 2 byte # OR a single character.
Changing my code from using CHAR(x) to INT(x) before creating my byte array fixed my problem.