Class Utf8CcsidManager
java.lang.Object
org.apache.derby.client.net.CcsidManager
org.apache.derby.client.net.Utf8CcsidManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CharsetEncoderprivate static final Stringprivate static final CharsetFields inherited from class CcsidManager
dot_, numToCharRepresentation_, numToSnaRequiredCrrtknChar_, space_, UTF8_CCSID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]convertFromJavaString(String sourceString, Agent agent) convertToJavaString(byte[] sourceBytes, int offset, int numToConvert) Offset and numToConvert are given in terms of bytes!booleanencode(CharBuffer src, ByteBuffer dest, Agent agent) Encode the contents of aCharBufferinto aByteBuffer.voidInitialize this instance for encoding a new string.
-
Field Details
-
UTF8
- See Also:
-
UTF8_CHARSET
-
encoder
-
-
Constructor Details
-
Utf8CcsidManager
public Utf8CcsidManager()
-
-
Method Details
-
convertFromJavaString
- Specified by:
convertFromJavaStringin classCcsidManager- Throws:
SqlException
-
convertToJavaString
Offset and numToConvert are given in terms of bytes! Not characters!- Specified by:
convertToJavaStringin classCcsidManager
-
startEncoding
public void startEncoding()Description copied from class:CcsidManagerInitialize this instance for encoding a new string. This method resets any internal state that may be left after earlier calls toCcsidManager.encode(CharBuffer, ByteBuffer, Agent)on this instance. For example, it may reset the internaljava.nio.charset.CharsetEncoder, if the implementation uses one to do the encoding.- Specified by:
startEncodingin classCcsidManager
-
encode
Description copied from class:CcsidManagerEncode the contents of aCharBufferinto aByteBuffer. The method will returntrueif 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 returnfalse. 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.- Specified by:
encodein classCcsidManager- Parameters:
src- buffer holding the characters to encodedest- buffer receiving the encoded bytesagent- where to report errors- Returns:
trueif all characters were encoded,falseif 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
-