|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.access.CharConverter
A character set converter between Java String objects and AS/400 native code pages.
Constructor Summary | |
CharConverter()
Deprecated. Replaced by CharConverter(int, AS400). Any CharConverter object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments. |
|
CharConverter(int ccsid)
Deprecated. Replaced by CharConverter(int, AS400). Any CharConverter object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments. |
|
CharConverter(int ccsid,
AS400 system)
Gets a CharConverter object from the pool using the specified ccsid and system. |
|
CharConverter(java.lang.String encoding)
Deprecated. Replaced by CharConverter(int, AS400). Any CharConverter object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments. |
Method Summary | |
static java.lang.String |
byteArrayToString(AS400 system,
byte[] source)
Converts the specified bytes into a String. |
java.lang.String |
byteArrayToString(byte[] source)
Converts the specified bytes into a String. |
java.lang.String |
byteArrayToString(byte[] source,
int offset)
Converts the specified bytes into a String. |
java.lang.String |
byteArrayToString(byte[] source,
int offset,
int length)
Converts the specified bytes into a String. |
java.lang.String |
byteArrayToString(byte[] source,
int offset,
int length,
int type)
Converts the specified bytes into a String. |
static java.lang.String |
byteArrayToString(int ccsid,
AS400 system,
byte[] source)
Converts the specified bytes into a String. |
int |
getCcsid()
Returns the ccsid of this conversion object. |
java.lang.String |
getEncoding()
Returns the encoding of this conversion object. |
static boolean |
isFaultTolerantConversion()
Indicates if conversion is fault tolerant. |
static void |
setFaultTolerantConversion(boolean faultTolerantConversion)
Enables fault tolerant conversion. |
static byte[] |
stringToByteArray(AS400 system,
java.lang.String source)
Converts the specified String into bytes. |
static byte[] |
stringToByteArray(int ccsid,
AS400 system,
java.lang.String source)
Converts the specified String into bytes. |
byte[] |
stringToByteArray(java.lang.String source)
Converts the specified String into bytes. |
void |
stringToByteArray(java.lang.String source,
byte[] destination)
Converts the specified String into bytes. |
void |
stringToByteArray(java.lang.String source,
byte[] destination,
int offset)
Converts the specified String into bytes. |
void |
stringToByteArray(java.lang.String source,
byte[] destination,
int offset,
int length)
Converts the specified String into bytes. |
void |
stringToByteArray(java.lang.String source,
byte[] destination,
int offset,
int length,
int type)
Converts the specified String into bytes. |
byte[] |
stringToByteArray(java.lang.String source,
int type)
Converts the specified String into bytes. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public CharConverter()
public CharConverter(java.lang.String encoding) throws java.io.UnsupportedEncodingException
encoding
- the name of a character encoding.public CharConverter(int ccsid) throws java.io.UnsupportedEncodingException
ccsid
- the CCSID of the AS/400 text.public CharConverter(int ccsid, AS400 system) throws java.io.UnsupportedEncodingException
ccsid
- the CCSID of the AS/400 text.system
- the 400 to go to for tableMethod Detail |
public java.lang.String byteArrayToString(byte[] source)
source
- the bytes to convert.public java.lang.String byteArrayToString(byte[] source, int offset)
source
- the bytes to convert.offset
- the offset into the source array for the start of the data.public java.lang.String byteArrayToString(byte[] source, int offset, int length)
source
- the bytes to convert.offset
- the offset into the source array for the start of the data.length
- the number of bytes of data to read from the array.public java.lang.String byteArrayToString(byte[] source, int offset, int length, int type)
source
- the bytes to convert.offset
- the offset into the source array for the start of the data.length
- the number of bytes of data to read from the array.type
- The bidi string type, as defined by the CDRA (Character
Data Representataion Architecture). See
BidiStringType for more information and valid values.BidiStringType
public static java.lang.String byteArrayToString(AS400 system, byte[] source)
system
- the 400 to go to for tablesource
- the bytes to convert.public static java.lang.String byteArrayToString(int ccsid, AS400 system, byte[] source) throws java.io.UnsupportedEncodingException
ccsid
- the CCSID of the AS/400 text.system
- the 400 to go to for tablesource
- the bytes to convert.public int getCcsid()
public java.lang.String getEncoding()
public static boolean isFaultTolerantConversion()
public static void setFaultTolerantConversion(boolean faultTolerantConversion)
faultTolerantConversion
- true to enable fault tolerant conversion, false
otherwise.public byte[] stringToByteArray(java.lang.String source)
source
- the String to convert.public byte[] stringToByteArray(java.lang.String source, int type)
source
- the String to convert.type
- the output string type as defined by the CDRA (Character Data Respresentation Architecture).
One of the following constants defined in BidiStringType: ST5 (LTR), ST6 (RTL), ST10 (Contextual LTR),
or ST11 (Contextual RTL).BidiStringType
public void stringToByteArray(java.lang.String source, byte[] destination) throws java.io.CharConversionException
source
- the String to convert.destination
- the destination byte array.public void stringToByteArray(java.lang.String source, byte[] destination, int offset) throws java.io.CharConversionException
source
- the String to convert.destination
- the destination byte array.offset
- the offset into the destination array for the start of the data.public void stringToByteArray(java.lang.String source, byte[] destination, int offset, int length) throws java.io.CharConversionException
source
- the String to convert.destination
- the destination byte array.offset
- the offset into the destination array for the start of the data.length
- the number of bytes of data to write into the array.public void stringToByteArray(java.lang.String source, byte[] destination, int offset, int length, int type) throws java.io.CharConversionException
source
- the String to convert.destination
- the destination byte array.offset
- the offset into the destination array for the start of the data.length
- the number of bytes of data to write into the array.type
- The bidi string type, as defined by the CDRA (Character
Data Representataion Architecture). See
BidiStringType for more information and valid values.BidiStringType
public static byte[] stringToByteArray(AS400 system, java.lang.String source)
system
- the 400 to go to for tablesource
- the String to convert.public static byte[] stringToByteArray(int ccsid, AS400 system, java.lang.String source) throws java.io.UnsupportedEncodingException
ccsid
- the CCSID of the AS/400 text.system
- the 400 to go to for tablesource
- the String to convert.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |