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.
-
CharConverter()
- Gets a CharConverter object from the pool using a "best guess" based on the default Locale.
-
CharConverter(int)
- Gets a CharConverter object from the pool using the specified ccsid.
-
CharConverter(int, AS400)
- Gets a CharConverter object from the pool using the specified ccsid and system.
-
CharConverter(String)
- Gets a CharConverter object from the pool using the specified character encoding.
-
byteArrayToString(byte[])
- Converts the specified bytes into a String.
-
byteArrayToString(byte[], int)
- Converts the specified bytes into a String.
-
byteArrayToString(byte[], int, int)
- Converts the specified bytes into a String.
-
getCcsid()
- Returns the ccsid of this conversion object.
-
getEncoding()
- Returns the encoding of this conversion object.
-
stringToByteArray(String)
- Converts the specified String into bytes.
-
stringToByteArray(String, byte[])
- Converts the specified String into bytes.
-
stringToByteArray(String, byte[], int)
- Converts the specified String into bytes.
-
stringToByteArray(String, byte[], int, int)
- Converts the specified String into bytes.
CharConverter
public CharConverter()
- Gets a CharConverter object from the pool using a "best guess" based on the default Locale.
CharConverter
public CharConverter(String encoding) throws UnsupportedEncodingException
- 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.
CharConverter
public CharConverter(int ccsid) throws UnsupportedEncodingException
- 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.
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.
byteArrayToString
public String byteArrayToString(byte source[])
- Converts the specified bytes into a String.
- Parameters:
- source - the bytes to convert.
- Returns:
- the resultant String.
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.
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.
getCcsid
public int getCcsid()
- Returns the ccsid of this conversion object.
- Returns:
- the ccsid.
getEncoding
public String getEncoding()
- Returns the encoding of this conversion object.
- Returns:
- the encoding.
stringToByteArray
public byte[] stringToByteArray(String source)
- Converts the specified String into bytes.
- Parameters:
- source - the String to convert.
- Returns:
- the resultant byte array.
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.
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.
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