All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.access.CharConverter

java.lang.Object
   |
   +----com.ibm.as400.access.CharConverter

public class CharConverter
extends Object
implements Serializable
A character set converter between Java String objects and AS/400 native code pages.


Constructor Index

 o CharConverter()
Gets a CharConverter object from the pool using a "best guess" based on the default Locale. Deprecated.
 o CharConverter(int)
Gets a CharConverter object from the pool using the specified ccsid. Deprecated.
 o CharConverter(int, AS400)
Gets a CharConverter object from the pool using the specified ccsid and system.
 o CharConverter(String)
Gets a CharConverter object from the pool using the specified character encoding. Deprecated.

Method Index

 o byteArrayToString(byte[])
Converts the specified bytes into a String.
 o byteArrayToString(byte[], int)
Converts the specified bytes into a String.
 o byteArrayToString(byte[], int, int)
Converts the specified bytes into a String.
 o getCcsid()
Returns the ccsid of this conversion object.
 o getEncoding()
Returns the encoding of this conversion object.
 o stringToByteArray(String)
Converts the specified String into bytes.
 o stringToByteArray(String, byte[])
Converts the specified String into bytes.
 o stringToByteArray(String, byte[], int)
Converts the specified String into bytes.
 o stringToByteArray(String, byte[], int, int)
Converts the specified String into bytes.

Constructors

 o CharConverter
 public CharConverter()
Note: CharConverter() is 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.

Gets a CharConverter object from the pool using a "best guess" based on the default Locale.

 o CharConverter
 public CharConverter(String encoding) throws UnsupportedEncodingException
Note: CharConverter() is 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.

Gets a CharConverter object from the pool using the specified character encoding.

Parameters:
encoding - the name of a character encoding.
Throws: UnsupportedEncodingException
If the encoding is not supported.
 o CharConverter
 public CharConverter(int ccsid) throws UnsupportedEncodingException
Note: CharConverter() is 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.

Gets a CharConverter object from the pool using the specified ccsid.

Parameters:
ccsid - the CCSID of the AS/400 text.
Throws: UnsupportedEncodingException
If the ccsid is not supported.
 o CharConverter
 public CharConverter(int ccsid,
                      AS400 system) throws UnsupportedEncodingException
Gets a CharConverter object from the pool using the specified ccsid and system.

Parameters:
ccsid - the CCSID of the AS/400 text.
system - the 400 to go to for table
Throws: UnsupportedEncodingException
If the ccsid is not supported.

Methods

 o byteArrayToString
 public String byteArrayToString(byte source[])
Converts the specified bytes into a String.

Parameters:
source - the bytes to convert.
Returns:
the resultant String.
 o byteArrayToString
 public String byteArrayToString(byte source[],
                                 int offset)
Converts the specified bytes into a String.

Parameters:
source - the bytes to convert.
offset - the offset into the source array for the start of the data.
Returns:
the resultant String.
 o byteArrayToString
 public String byteArrayToString(byte source[],
                                 int offset,
                                 int length)
Converts the specified bytes into a String.

Parameters:
source - the bytes to convert.
offset - the offset into the source array for the start of the data.
length - the length of data to read from the array.
Returns:
the resultant String.
 o getCcsid
 public int getCcsid()
Returns the ccsid of this conversion object.

Returns:
the ccsid.
 o getEncoding
 public String getEncoding()
Returns the encoding of this conversion object.

Returns:
the encoding.
 o stringToByteArray
 public byte[] stringToByteArray(String source)
Converts the specified String into bytes.

Parameters:
source - the String to convert.
Returns:
the resultant byte array.
 o stringToByteArray
 public void stringToByteArray(String source,
                               byte destination[]) throws CharConversionException
Converts the specified String into bytes.

Parameters:
source - the String to convert.
destination - the destination byte array.
Throws: CharConversionException
If destination is not large enough to hold the converted string.
 o stringToByteArray
 public void stringToByteArray(String source,
                               byte destination[],
                               int offset) throws CharConversionException
Converts the specified String into bytes.

Parameters:
source - the String to convert.
destination - the destination byte array.
offset - the offset into the destination array for the start of the data.
Throws: CharConversionException
If destination is not large enough to hold the converted string.
 o stringToByteArray
 public void stringToByteArray(String source,
                               byte destination[],
                               int offset,
                               int length) throws CharConversionException
Converts the specified String into bytes.

Parameters:
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 length of data to write into the array.
Throws: CharConversionException
If destination is not large enough to hold the converted string.

All Packages  Class Hierarchy  This Package  Previous  Next  Index