Top Fields Constructors Methods
org.apache.derby.impl.drda

pack-priv abstract Class CcsidManager

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.derby.impl.drda.EbcdicCcsidManager, org.apache.derby.impl.drda.Utf8CcsidManager
Imports
java.nio.ByteBuffer

Field Summary

Modifier and TypeField and Description
pack-priv byte
pack-priv byte[]
pack-priv byte
public static final int

Constructor Summary

AccessConstructor and Description
pack-priv
CcsidManager(byte space, byte dot, byte[] numToCharRepresentation)

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract byte[]
pack-priv abstract void
convertFromJavaString(String
A Java String to convert.
sourceString
,
ByteBuffer
The buffer to convert the String into.
buffer
)

Convert a Java String into bytes for a particular ccsid.

pack-priv abstract String
convertToJavaString(byte[] sourceBytes)

pack-priv abstract String

Returns:

A new Java String Object created after conversion.
convertToJavaString
(byte[]
An array of bytes to be converted.
sourceBytes
,
int
An offset indicating first byte to convert.
offset
,
int
The number of bytes to be converted.
numToConvert
)

Convert a byte array representing characters in a particular ccsid into a Java String.

pack-priv abstract int

Returns:

The length in bytes of the String str.
getByteLength
(String
The Java String from which to obtain the length.
str
)

Returns the length in bytes for the String str using a particular ccsid.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dotback to summary
pack-priv byte dot
numToCharRepresentationback to summary
pack-priv byte[] numToCharRepresentation
spaceback to summary
pack-priv byte space
UTF8_CCSIDback to summary
public static final int UTF8_CCSID

Constructor Detail

CcsidManagerback to summary
pack-priv CcsidManager(byte space, byte dot, byte[] numToCharRepresentation)

Method Detail

convertFromJavaStringback to summary
pack-priv abstract byte[] convertFromJavaString(String sourceString)
convertFromJavaStringback to summary
pack-priv abstract void convertFromJavaString(String sourceString, ByteBuffer buffer)

Convert a Java String into bytes for a particular ccsid. The String is converted into a buffer provided by the caller.

Parameters
sourceString:String

A Java String to convert.

buffer:ByteBuffer

The buffer to convert the String into.

convertToJavaStringback to summary
pack-priv abstract String convertToJavaString(byte[] sourceBytes)
convertToJavaStringback to summary
pack-priv abstract String convertToJavaString(byte[] sourceBytes, int offset, int numToConvert)

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.

Parameters
sourceBytes:byte[]

An array of bytes to be converted.

offset:int

An offset indicating first byte to convert.

numToConvert:int

The number of bytes to be converted.

Returns:String

A new Java String Object created after conversion.

getByteLengthback to summary
pack-priv abstract int getByteLength(String str)

Returns the length in bytes for the String str using a particular ccsid.

Parameters
str:String

The Java String from which to obtain the length.

Returns:int

The length in bytes of the String str.