|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.etools.iseries.edit.verifiers.comm.bridge.DataConversionStaticHelpers
public class DataConversionStaticHelpers
This class contains static methods for converting Java data types to the corresponding C data types. Here is the mapping table Java datatype C datatype C datatype lenght (bytes) short short 2 int unsigned short 2 int int 4 long unsigned int 4 int long 4 long unsigned long 4 char char 1 char unsigned char 1
Field Summary | |
---|---|
static String |
copyright
|
Method Summary | |
---|---|
static char |
cCharToJavaChar(byte buffer)
Convert a C char to Java char |
static int |
cIntToJavaInt(byte[] buffer)
Convert a C int to Java int |
static int |
cLongToJavaInt(byte[] buffer)
Convert a C long to Java int |
static short |
cShortToJavaShort(byte[] buffer)
Convert a C short to Java short. |
static String |
cStringToJavaString(byte[] buffer)
Convert a C char array (string) to Java String |
static char |
cUnsignedCharToJavaChar(byte buffer)
Convert a C unsigned char to Java char |
static long |
cUnsignedIntToJavaLong(byte[] buffer)
Convert a C unsigned int to Java long |
static long |
cUnsignedLongToJavaLong(byte[] buffer)
Convert a C unsigned long to Java long |
static int |
cUnsignedShortToJavaInt(byte[] buffer)
Convert a C unsigned short to Java int |
static String |
insertShiftInShiftOut(String source)
Insert the shift in / shift out characters for Strings which contain DBCS characters. |
static byte |
javaCharToCChar(char value)
Convert a 2 byte Unicode character to a 1 byte C char |
static byte |
javaCharToCUnsignedChar(char value)
Convert a 2 byte Unicode character to a 1 byte unsigned C char |
static byte[] |
javaIntToCInt(int value)
Convert a Java int to a C int. |
static byte[] |
javaIntToCLong(int value)
Convert a Java int to a C long (in C longs are only 4 bytes which is equivalent to a Java int) |
static byte[] |
javaIntToCUnsignedShort(int value)
Convert a Java int to a C unsigned short. |
static byte[] |
javaLongToCUnsignedInt(long value)
Convert a Java long to a C unsigned int. |
static byte[] |
javaLongToCUnsignedLong(long value)
Convert a Java long to a C unsigned long. |
static byte[] |
javaShortToCShort(short value)
Convert a Java short to C short. |
static byte[] |
javaStringToCCharArray(String value)
Convert a Java Unicode string to a C char array |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String copyright
Method Detail |
---|
public static byte[] javaShortToCShort(short value)
public static byte[] javaIntToCUnsignedShort(int value)
public static byte[] javaIntToCInt(int value)
public static byte[] javaLongToCUnsignedInt(long value)
public static byte[] javaIntToCLong(int value)
public static byte[] javaLongToCUnsignedLong(long value)
public static byte javaCharToCChar(char value)
public static byte javaCharToCUnsignedChar(char value)
public static byte[] javaStringToCCharArray(String value)
public static short cShortToJavaShort(byte[] buffer)
buffer
- byte array containing the c short value. The
array must have a length >= 2. If the length > 2 only the
first two bytes are used.public static int cUnsignedShortToJavaInt(byte[] buffer)
public static int cIntToJavaInt(byte[] buffer)
public static long cUnsignedIntToJavaLong(byte[] buffer)
public static int cLongToJavaInt(byte[] buffer)
public static long cUnsignedLongToJavaLong(byte[] buffer)
public static char cCharToJavaChar(byte buffer)
public static char cUnsignedCharToJavaChar(byte buffer)
public static String cStringToJavaString(byte[] buffer)
public static String insertShiftInShiftOut(String source)
|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |