Package org.apache.derby.impl.drda
Class EbcdicCcsidManager
java.lang.Object
org.apache.derby.impl.drda.CcsidManager
org.apache.derby.impl.drda.EbcdicCcsidManager
A concrete implementation of a CcsidMgr used to convert
between Java UCS2 and Ebcdic as needed to handle character
DDM Parameters. This implementation only supports converting
from the ASCII invariant of UNICODE to Ebcdic. This should
be fine since this class is intended for converting
DDM Parameter data only.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int[]
private static final int[]
Fields inherited from class org.apache.derby.impl.drda.CcsidManager
dot, numToCharRepresentation, space, UTF8_CCSID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) byte[]
convertFromJavaString
(String sourceString) (package private) void
convertFromJavaString
(String sourceString, ByteBuffer buffer) Convert a Java String into bytes for a particular ccsid.(package private) String
convertToJavaString
(byte[] sourceBytes) (package private) String
convertToJavaString
(byte[] sourceBytes, int offset, int numToConvert) Convert a byte array representing characters in a particular ccsid into a Java String.(package private) int
getByteLength
(String str) Returns the length in bytes for the String str using a particular ccsid.
-
Field Details
-
conversionArrayToEbcdic
private static final int[] conversionArrayToEbcdic -
conversionArrayToUCS2
private static final int[] conversionArrayToUCS2
-
-
Constructor Details
-
EbcdicCcsidManager
EbcdicCcsidManager()
-
-
Method Details
-
convertFromJavaString
- Specified by:
convertFromJavaString
in classCcsidManager
-
convertFromJavaString
Description copied from class:CcsidManager
Convert a Java String into bytes for a particular ccsid. The String is converted into a buffer provided by the caller.- Specified by:
convertFromJavaString
in classCcsidManager
- Parameters:
sourceString
- A Java String to convert.buffer
- The buffer to convert the String into.
-
convertToJavaString
- Specified by:
convertToJavaString
in classCcsidManager
-
convertToJavaString
Description copied from class:CcsidManager
Convert a byte array representing characters in a particular ccsid into a Java String. Mind the fact that for certain encodings (e.g. UTF8), the offset and numToConvert actually represent characters and 1 character does not always equal to 1 byte.- Specified by:
convertToJavaString
in classCcsidManager
- Parameters:
sourceBytes
- An array of bytes to be converted.offset
- An offset indicating first byte to convert.numToConvert
- The number of bytes to be converted.- Returns:
- A new Java String Object created after conversion.
-
getByteLength
Description copied from class:CcsidManager
Returns the length in bytes for the String str using a particular ccsid.- Specified by:
getByteLength
in classCcsidManager
- Parameters:
str
- The Java String from which to obtain the length.- Returns:
- The length in bytes of the String str.
-