Top Fields Constructors Methods
org.apache.derby.client.net

pack-priv abstract Class CcsidManager

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.derby.client.net.EbcdicCcsidManager, org.apache.derby.client.net.Utf8CcsidManager
Imports
java.nio.ByteBuffer, .CharBuffer, org.apache.derby.client.am.Agent, .SqlException

Field Summary

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

Constructor Summary

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

Method Summary

Modifier and TypeMethod and Description
public abstract byte[]
convertFromJavaString(String sourceString, Agent agent)

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

public abstract boolean

Returns:

true if all characters were encoded, false if the destination buffer is full and there still are more characters to encode
encode
(CharBuffer
buffer holding the characters to encode
src
,
ByteBuffer
buffer receiving the encoded bytes
dest
,
Agent
where to report errors
agent
)

Encode the contents of a CharBuffer into a ByteBuffer.

public abstract void
startEncoding()

Initialize this instance for encoding a new string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dot_back to summary
pack-priv byte dot_
numToCharRepresentation_back to summary
pack-priv byte[] numToCharRepresentation_
numToSnaRequiredCrrtknChar_back to summary
pack-priv byte[] numToSnaRequiredCrrtknChar_
space_back to summary
pack-priv byte space_
UTF8_CCSIDback to summary
pack-priv static final int UTF8_CCSID

Constructor Detail

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

Method Detail

convertFromJavaStringback to summary
public abstract byte[] convertFromJavaString(String sourceString, Agent agent) throws SqlException
convertToJavaStringback to summary
pack-priv abstract String convertToJavaString(byte[] sourceBytes, int offset, int numToConvert)
encodeback to summary
public abstract boolean encode(CharBuffer src, ByteBuffer dest, Agent agent) throws SqlException

Encode the contents of a CharBuffer into a ByteBuffer. The method will return true if all the characters were encoded and copied to the destination. If the receiving byte buffer is too small to hold the entire encoded representation of the character buffer, the method will return false. The caller should then allocate a larger byte buffer, copy the contents from the old byte buffer to the new one, and then call this method again to get the remaining characters encoded.

Parameters
src:CharBuffer

buffer holding the characters to encode

dest:ByteBuffer

buffer receiving the encoded bytes

agent:Agent

where to report errors

Returns:boolean

true if all characters were encoded, false if the destination buffer is full and there still are more characters to encode

Exceptions
SqlException:
if the characters cannot be encoded using this CCSID manager's character encoding
startEncodingback to summary
public abstract void startEncoding()

Initialize this instance for encoding a new string. This method resets any internal state that may be left after earlier calls to encode on this instance. For example, it may reset the internal java.nio.charset.CharsetEncoder, if the implementation uses one to do the encoding.