org.apache.derby.client.net
Class CcsidManager
java.lang.Object
org.apache.derby.client.net.CcsidManager
- Direct Known Subclasses:
- EbcdicCcsidManager, Utf8CcsidManager
public abstract class CcsidManager
- extends java.lang.Object
|
Constructor Summary |
CcsidManager(byte space,
byte dot,
byte[] numToCharRepresentation,
byte[] numToSnaRequiredCrrtknChar)
|
|
Method Summary |
abstract byte[] |
convertFromJavaString(java.lang.String sourceString,
Agent agent)
|
(package private) abstract java.lang.String |
convertToJavaString(byte[] sourceBytes,
int offset,
int numToConvert)
|
abstract boolean |
encode(java.nio.CharBuffer src,
java.nio.ByteBuffer dest,
Agent agent)
Encode the contents of a CharBuffer into a ByteBuffer. |
abstract void |
startEncoding()
Initialize this instance for encoding a new string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
space_
public byte space_
dot_
byte dot_
numToCharRepresentation_
byte[] numToCharRepresentation_
numToSnaRequiredCrrtknChar_
byte[] numToSnaRequiredCrrtknChar_
UTF8_CCSID
public static final int UTF8_CCSID
- See Also:
- Constant Field Values
CcsidManager
CcsidManager(byte space,
byte dot,
byte[] numToCharRepresentation,
byte[] numToSnaRequiredCrrtknChar)
convertFromJavaString
public abstract byte[] convertFromJavaString(java.lang.String sourceString,
Agent agent)
throws SqlException
- Throws:
SqlException
convertToJavaString
abstract java.lang.String convertToJavaString(byte[] sourceBytes,
int offset,
int numToConvert)
startEncoding
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(java.nio.CharBuffer, java.nio.ByteBuffer, org.apache.derby.client.am.Agent) on this instance. For example, it may reset the
internal java.nio.charset.CharsetEncoder, if the implementation
uses one to do the encoding.
encode
public abstract boolean encode(java.nio.CharBuffer src,
java.nio.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 - buffer holding the characters to encodedest - buffer receiving the encoded bytesagent - where to report errors
- Returns:
true if all characters were encoded, false if
the destination buffer is full and there still are more characters to
encode
- Throws:
SqlException - if the characters cannot be encoded using this
CCSID manager's character encoding
Apache Derby V10.10 Internals - Copyright © 2004,2013 The Apache Software Foundation. All Rights Reserved.