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

pack-priv Class EbcdicCcsidManager

extends CcsidManager
Class Inheritance
Imports
java.nio.ByteBuffer, .CharBuffer, org.apache.derby.client.am.Agent, .SqlException, .ClientMessageId, org.apache.derby.shared.common.reference.SQLState

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

Modifier and TypeField and Description
private static final int[]
private static final int[]
Inherited from org.apache.derby.client.net.CcsidManager:
dot_numToCharRepresentation_numToSnaRequiredCrrtknChar_space_UTF8_CCSID

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public byte[]
pack-priv String
convertToJavaString(byte[] sourceBytes, int offset, int numToConvert)

Implements abstract org.apache.derby.client.net.CcsidManager.convertToJavaString.

public boolean
encode(CharBuffer
buffer holding the characters to encode
src
,
ByteBuffer
buffer receiving the encoded bytes
dest
,
Agent
where to report errors
agent
)

Implements abstract org.apache.derby.client.net.CcsidManager.encode.

Encode the contents of a CharBuffer into a ByteBuffer.
public void
startEncoding()

Implements abstract org.apache.derby.client.net.CcsidManager.startEncoding.

Initialize this instance for encoding a new string.

Field Detail

conversionArrayToEbcdicback to summary
private static final int[] conversionArrayToEbcdic
conversionArrayToUCS2back to summary
private static final int[] conversionArrayToUCS2

Constructor Detail

EbcdicCcsidManagerback to summary
public EbcdicCcsidManager()

Method Detail

convertFromJavaStringback to summary
public byte[] convertFromJavaString(String sourceString, Agent agent) throws SqlException

Implements abstract org.apache.derby.client.net.CcsidManager.convertFromJavaString.

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

Implements abstract org.apache.derby.client.net.CcsidManager.convertToJavaString.

encodeback to summary
public boolean encode(CharBuffer src, ByteBuffer dest, Agent agent) throws SqlException

Implements abstract org.apache.derby.client.net.CcsidManager.encode.

Doc from org.apache.derby.client.net.CcsidManager.encode.

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 void startEncoding()

Implements abstract org.apache.derby.client.net.CcsidManager.startEncoding.

Doc from org.apache.derby.client.net.CcsidManager.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.