CharacterSetWithConverter
public abstract class CharacterSet extends Object
Most methods are of conversions between character representations.
There are no public constructors. To create a CharacterSet use oracle.sql.CharacterSetFactory. There is no notion of "unsupported" character set. CharacterSet's can be created with any oracleId. However, there is a notion of unsupported conversions and the current implementation is limited to the small number of character sets for which constants are defined in the class
There are two variants of an operation (e.g. convert vs. convertUnshared) the plain version is the fast (but possibly unsafe) one.
The descriptions of methods in this class use the phrase "bytes in oracleId representation". What this means is that the bytes can be interpreted as a sequence of characters in the character set defined by oracleId. Both what characters are available and how they are represented as sequences of bytes is determined by oracleId.
Modifier and Type | Method | Description |
---|---|---|
static int |
AL16UTF16BytesToJavaChars(byte[] bytes, int nbytes, char[] chars) |
Convert a sequence of bytes in AL16UTF16 to an array of chars caller needs to allocate the chars array
|
static String |
AL16UTF16BytesToString(byte[] bytes, int nbytes) |
Convert a sequence of bytes in AL16UTF16 to a String this function will allocate a chars array
|
static char[] |
AL32UTF8ToJavaChar(byte[] bytes, int offset, int count, boolean useReplacementCharacter) |
Converts an AL32UTF8 byte array to an array of char.
|
static String |
AL32UTF8ToString(byte[] bytes, int offset, int nbytes) |
Convert a sequence of bytes in AL32UTF8 format to a String.
|
static String |
AL32UTF8ToString(byte[] bytes, int offset, int nbytes, boolean useReplacementCharacter) |
|
abstract byte[] |
convert(String s) |
Convert a String to bytes in oracleId representation.
|
abstract byte[] |
convert(CharacterSet from, byte[] source, int offset, int count) |
Converts bytes in some representation to oracleId representation.
|
static int |
convertAL16UTF16BytesToJavaChars(byte[] bytes, int offset, char[] chars, int chars_offset, int count, boolean convertWithReplacement) |
Converts a sequence of bytes in AL16UTF16 to an array of char's.
|
static int |
convertAL16UTF16LEBytesToJavaChars(byte[] bytes, int offset, char[] chars, int chars_offset, int count, boolean convertWithReplacement) |
Converts a sequence of bytes in AL16UTF16LE to an array of char's.
|
static int |
convertAL32UTF8BytesToJavaChars(byte[] bytes, int offsetBytes, char[] chars, int offsetChars, int[] countArr, boolean convertWithReplacement) |
Convert a sequence of bytes in AL32UTF8 to an array of char's.
|
static int |
convertAL32UTF8BytesToJavaChars(byte[] bytes, int offsetBytes, char[] chars, int offsetChars, int[] countArr, boolean convertWithReplacement, int charSize) |
Same as convertAL32UTF8BytesToJavaChars(byte[],int,char[],int,int[],boolean) with an additional argument 'charSize' which is the number of chars available in the char array.
|
static int |
convertASCIIBytesToJavaChars(byte[] bytes, int bytes_offset, char[] chars, int chars_offset, int count) |
convert a byte array in ascii to a Java char array.
|
static int |
convertJavaCharsToAL16UTF16Bytes(char[] chars, int chars_offset, byte[] bytes, int bytes_offset, int nchars) |
|
static int |
convertJavaCharsToAL16UTF16LEBytes(char[] chars, int chars_offset, byte[] bytes, int bytes_offset, int nchars) |
|
static int |
convertJavaCharsToAL32UTF8Bytes(char[] chars, int chars_offset, byte[] bytes, int bytes_begin, int chars_count) |
Convert char's to the UTF-8 representation.
|
static int |
convertJavaCharsToASCIIBytes(char[] chars, int chars_offset, byte[] bytes, int bytes_offset, int nchars) |
convert a Java char array to a byte array in ascii.
|
static int |
convertJavaCharsToASCIIBytes(char[] chars, int chars_offset, byte[] bytes, int bytes_offset, int nchars, boolean strictConversion) |
|
static int |
convertJavaCharsToISOLATIN1Bytes(char[] chars, int chars_offset, byte[] bytes, int bytes_offset, int nchars) |
|
static int |
convertJavaCharsToUTFBytes(char[] chars, int chars_offset, byte[] bytes, int bytes_begin, int chars_count) |
Convert char's to the UTF8 representation.
|
byte[] |
convertUnshared(CharacterSet from, byte[] source, int offset, int count) |
Converts bytes in some representation to oracleId representation.
|
static long |
convertUTF32toUTF16(long ucs4ch) |
|
static int |
convertUTFBytesToJavaChars(byte[] bytes, int offset, char[] chars, int chars_offset, int[] countArr, boolean convertWithReplacement) |
Convert a sequence of bytes in UTF8 to an array of char's.
|
static int |
convertUTFBytesToJavaChars(byte[] bytes, int offset, char[] chars, int chars_offset, int[] countArr, boolean convertWithReplacement, int charSize) |
Convert a sequence of bytes in UTF8 to an array of char's.
|
byte[] |
convertWithReplacement(char[] chars, int charOffset, byte[] bytes, int byteOffset, int[] nchars) |
Similar to convertWithReplacement(String s); Instead of a string, a char[] + offset with a length stored in nchars[0] will be converted.
|
abstract byte[] |
convertWithReplacement(String s) |
Convert a String to bytes in oracleId representation.
|
int |
encodedByteLength(char[] carray) |
Return the length of the byte array which would result if the char array were encoded in this character set
|
int |
encodedByteLength(String s) |
Return the length of the byte array which would result if the String were encoded in this character set
|
boolean |
equals(Object rhs) |
Two CharacterSet's are equal when their oracleId's are equal
|
protected oracle.jdbc.internal.OracleConnection |
getConnectionDuringExceptionHandling() |
|
int |
getOracleId() |
The integer that identifies the character set.
|
int |
hashCode() |
Implements a hash based on oracleId
|
abstract boolean |
isConvertibleFrom(CharacterSet source) |
Are conversions supported.
|
abstract boolean |
isLossyFrom(CharacterSet from) |
A conversion looses information if the mapping is not invertible.
|
boolean |
isUnicode() |
Is this a Unicode Character Set.
|
boolean |
isUnknown() |
|
static int |
javaCharsToAL16UTF16Bytes(char[] chars, int nchars, byte[] bytes) |
Convert a sequence of chars in UCS2 to an array of bytes caller needs to allocate the bytes array
|
static int |
javaCharsToAL16UTF16LEBytes(char[] chars, int nchars, byte[] bytes) |
Convert a sequence of chars in UCS2 to an array of bytes caller needs to allocate the bytes array
|
static CharacterSet |
make(int oracleId) |
Factory.
|
static int |
string32UTF8Length(String s) |
Returns the number of bytes in the UTF-8 representation of a String
|
static byte[] |
stringToAL16UTF16Bytes(String str) |
Convert a String to an array of bytes this function will allocate the bytes array
|
static byte[] |
stringToAL16UTF16LEBytes(String str) |
Convert a String to an array of bytes this function will allocate the bytes array
|
static byte[] |
stringToAL32UTF8(String str) |
|
static byte[] |
stringToASCII(String str) |
convert a String to a byte array in ascii.
|
static byte[] |
stringToUTF(String str) |
Convert the str to a byte array that in UTF8 representation.
|
static int |
stringUTFLength(String s) |
Returns the number of bytes in the UTF8 representation of a String
|
String |
toString() |
The official name of the character set.
|
String |
toString(byte[] bytes, int offset, int count) |
Convert bytes in oracleId representation to a String.
|
abstract String |
toStringWithReplacement(byte[] bytes, int offset, int count) |
Convert bytes in oracleId representation to a String.
|
static char[] |
UTFToJavaChar(byte[] bytes, int offset, int count) |
Convert a sequence of bytes in UTF8 to an array of char's.
|
static char[] |
UTFToJavaChar(byte[] bytes, int offset, int count, boolean useReplacementChar) |
Convert a sequence of bytes in UTF8 to an array of char's.
|
static char[] |
UTFToJavaCharWithReplacement(byte[] bytes, int offset, int count) |
Convert a sequence of bytes in UTF8 to an array of char's.
|
static String |
UTFToString(byte[] bytes, int offset, int nbytes) |
Convert a sequence of bytes in UTF8 to a String this function will to allocate the chars array
|
static String |
UTFToString(byte[] bytes, int offset, int nbytes, boolean useReplacementChar) |
Convert a sequence of bytes in UTF8 to a String this function will to allocate the chars array
|
public static final short DEFAULT_CHARSET
public static final short ASCII_CHARSET
public static final short ISO_LATIN_1_CHARSET
public static final short UNICODE_1_CHARSET
public static final short US7ASCII_CHARSET
public static final short WE8DEC_CHARSET
public static final short WE8HP_CHARSET
public static final short US8PC437_CHARSET
public static final short WE8EBCDIC37_CHARSET
public static final short WE8EBCDIC500_CHARSET
public static final short WE8EBCDIC285_CHARSET
public static final short WE8PC850_CHARSET
public static final short D7DEC_CHARSET
public static final short F7DEC_CHARSET
public static final short S7DEC_CHARSET
public static final short E7DEC_CHARSET
public static final short SF7ASCII_CHARSET
public static final short NDK7DEC_CHARSET
public static final short I7DEC_CHARSET
public static final short NL7DEC_CHARSET
public static final short CH7DEC_CHARSET
public static final short YUG7ASCII_CHARSET
public static final short SF7DEC_CHARSET
public static final short TR7DEC_CHARSET
public static final short IW7IS960_CHARSET
public static final short IN8ISCII_CHARSET
public static final short WE8ISO8859P1_CHARSET
public static final short EE8ISO8859P2_CHARSET
public static final short SE8ISO8859P3_CHARSET
public static final short NEE8ISO8859P4_CHARSET
public static final short CL8ISO8859P5_CHARSET
public static final short AR8ISO8859P6_CHARSET
public static final short EL8ISO8859P7_CHARSET
public static final short IW8ISO8859P8_CHARSET
public static final short WE8ISO8859P9_CHARSET
public static final short NE8ISO8859P10_CHARSET
public static final short TH8TISASCII_CHARSET
public static final short TH8TISEBCDIC_CHARSET
public static final short BN8BSCII_CHARSET
public static final short VN8VN3_CHARSET
public static final short VN8MSWIN1258_CHARSET
public static final short WE8ISO8859P15_CHARSET
public static final short WE8NEXTSTEP_CHARSET
public static final short AR8ASMO708PLUS_CHARSET
public static final short AR8EBCDICX_CHARSET
public static final short AR8XBASIC_CHARSET
public static final short EL8DEC_CHARSET
public static final short TR8DEC_CHARSET
public static final short WE8EBCDIC37C_CHARSET
public static final short WE8EBCDIC500C_CHARSET
public static final short IW8EBCDIC424_CHARSET
public static final short TR8EBCDIC1026_CHARSET
public static final short WE8EBCDIC871_CHARSET
public static final short WE8EBCDIC284_CHARSET
public static final short WE8EBCDIC1047_CHARSET
public static final short EEC8EUROASCI_CHARSET
public static final short EEC8EUROPA3_CHARSET
public static final short LA8PASSPORT_CHARSET
public static final short BG8PC437S_CHARSET
public static final short EE8PC852_CHARSET
public static final short RU8PC866_CHARSET
public static final short RU8BESTA_CHARSET
public static final short IW8PC1507_CHARSET
public static final short RU8PC855_CHARSET
public static final short TR8PC857_CHARSET
public static final short CL8MACCYRILLIC_CHARSET
public static final short CL8MACCYRILLICS_CHARSET
public static final short WE8PC860_CHARSET
public static final short IS8PC861_CHARSET
public static final short EE8MACCES_CHARSET
public static final short EE8MACCROATIANS_CHARSET
public static final short TR8MACTURKISHS_CHARSET
public static final short IS8MACICELANDICS_CHARSET
public static final short EL8MACGREEKS_CHARSET
public static final short IW8MACHEBREWS_CHARSET
public static final short EE8MSWIN1250_CHARSET
public static final short CL8MSWIN1251_CHARSET
public static final short ET8MSWIN923_CHARSET
public static final short BG8MSWIN_CHARSET
public static final short EL8MSWIN1253_CHARSET
public static final short IW8MSWIN1255_CHARSET
public static final short LT8MSWIN921_CHARSET
public static final short TR8MSWIN1254_CHARSET
public static final short WE8MSWIN1252_CHARSET
public static final short BLT8MSWIN1257_CHARSET
public static final short D8EBCDIC273_CHARSET
public static final short I8EBCDIC280_CHARSET
public static final short DK8EBCDIC277_CHARSET
public static final short S8EBCDIC278_CHARSET
public static final short EE8EBCDIC870_CHARSET
public static final short CL8EBCDIC1025_CHARSET
public static final short F8EBCDIC297_CHARSET
public static final short IW8EBCDIC1086_CHARSET
public static final short CL8EBCDIC1025X_CHARSET
public static final short N8PC865_CHARSET
public static final short BLT8CP921_CHARSET
public static final short LV8PC1117_CHARSET
public static final short LV8PC8LR_CHARSET
public static final short BLT8EBCDIC1112_CHARSET
public static final short LV8RST104090_CHARSET
public static final short CL8KOI8R_CHARSET
public static final short BLT8PC775_CHARSET
public static final short F7SIEMENS9780X_CHARSET
public static final short E7SIEMENS9780X_CHARSET
public static final short S7SIEMENS9780X_CHARSET
public static final short DK7SIEMENS9780X_CHARSET
public static final short N7SIEMENS9780X_CHARSET
public static final short I7SIEMENS9780X_CHARSET
public static final short D7SIEMENS9780X_CHARSET
public static final short WE8GCOS7_CHARSET
public static final short EL8GCOS7_CHARSET
public static final short US8BS2000_CHARSET
public static final short D8BS2000_CHARSET
public static final short F8BS2000_CHARSET
public static final short E8BS2000_CHARSET
public static final short DK8BS2000_CHARSET
public static final short S8BS2000_CHARSET
public static final short WE8BS2000_CHARSET
public static final short CL8BS2000_CHARSET
public static final short WE8BS2000L5_CHARSET
public static final short WE8DG_CHARSET
public static final short WE8NCR4970_CHARSET
public static final short WE8ROMAN8_CHARSET
public static final short EE8MACCE_CHARSET
public static final short EE8MACCROATIAN_CHARSET
public static final short TR8MACTURKISH_CHARSET
public static final short IS8MACICELANDIC_CHARSET
public static final short EL8MACGREEK_CHARSET
public static final short IW8MACHEBREW_CHARSET
public static final short US8ICL_CHARSET
public static final short WE8ICL_CHARSET
public static final short WE8ISOICLUK_CHARSET
public static final short WE8MACROMAN8_CHARSET
public static final short WE8MACROMAN8S_CHARSET
public static final short TH8MACTHAI_CHARSET
public static final short TH8MACTHAIS_CHARSET
public static final short HU8CWI2_CHARSET
public static final short EL8PC437S_CHARSET
public static final short EL8EBCDIC875_CHARSET
public static final short EL8PC737_CHARSET
public static final short LT8PC772_CHARSET
public static final short LT8PC774_CHARSET
public static final short EL8PC869_CHARSET
public static final short EL8PC851_CHARSET
public static final short CDN8PC863_CHARSET
public static final short HU8ABMOD_CHARSET
public static final short AR8ASMO8X_CHARSET
public static final short AR8NAFITHA711T_CHARSET
public static final short AR8SAKHR707T_CHARSET
public static final short AR8MUSSAD768T_CHARSET
public static final short AR8ADOS710T_CHARSET
public static final short AR8ADOS720T_CHARSET
public static final short AR8APTEC715T_CHARSET
public static final short AR8NAFITHA721T_CHARSET
public static final short AR8HPARABIC8T_CHARSET
public static final short AR8NAFITHA711_CHARSET
public static final short AR8SAKHR707_CHARSET
public static final short AR8MUSSAD768_CHARSET
public static final short AR8ADOS710_CHARSET
public static final short AR8ADOS720_CHARSET
public static final short AR8APTEC715_CHARSET
public static final short AR8MSAWIN_CHARSET
public static final short AR8NAFITHA721_CHARSET
public static final short AR8SAKHR706_CHARSET
public static final short AR8ARABICMAC_CHARSET
public static final short AR8ARABICMACS_CHARSET
public static final short AR8ARABICMACT_CHARSET
public static final short LA8ISO6937_CHARSET
public static final short US8NOOP_CHARSET
public static final short WE8DECTST_CHARSET
public static final short JA16VMS_CHARSET
public static final short JA16EUC_CHARSET
public static final short JA16EUCYEN_CHARSET
public static final short JA16SJIS_CHARSET
public static final short JA16DBCS_CHARSET
public static final short JA16SJISYEN_CHARSET
public static final short JA16EBCDIC930_CHARSET
public static final short JA16MACSJIS_CHARSET
public static final short JA16EUCTILDE_CHARSET
public static final short JA16SJISTILDE_CHARSET
public static final short KO16KSC5601_CHARSET
public static final short KO16DBCS_CHARSET
public static final short KO16KSCCS_CHARSET
public static final short KO16MSWIN949_CHARSET
public static final short ZHS16CGB231280_CHARSET
public static final short ZHS16MACCGB231280_CHARSET
public static final short ZHS16GBK_CHARSET
public static final short ZHS16DBCS_CHARSET
public static final short ZHS32GB18030_CHARSET
public static final short ZHT32EUC_CHARSET
public static final short ZHT32SOPS_CHARSET
public static final short ZHT16DBT_CHARSET
public static final short ZHT32TRIS_CHARSET
public static final short ZHT16DBCS_CHARSET
public static final short ZHT16BIG5_CHARSET
public static final short ZHT16CCDC_CHARSET
public static final short ZHT16MSWIN950_CHARSET
public static final short AL24UTFFSS_CHARSET
public static final short UTF8_CHARSET
public static final short UTFE_CHARSET
public static final short AL32UTF8_CHARSET
public static final short KO16TSTSET_CHARSET
public static final short JA16TSTSET2_CHARSET
public static final short JA16TSTSET_CHARSET
public static final short US16TSTFIXED_CHARSET
public static final short AL16UTF16_CHARSET
public static final short AL16UTF16LE_CHARSET
public static final short TH8TISEBCDICS_CHARSET
public static final short BLT8EBCDIC1112S_CHARSET
public static final short CE8BS2000_CHARSET
public static final short CL8EBCDIC1025R_CHARSET
public static final short CL8EBCDIC1158R_CHARSET
public static final short D8EBCDIC1141_CHARSET
public static final short DK8EBCDIC1142_CHARSET
public static final short EE8BS2000_CHARSET
public static final short EE8EBCDIC870S_CHARSET
public static final short EL8EBCDIC423R_CHARSET
public static final short EL8EBCDIC875S_CHARSET
public static final short EL8EBCDIC875R_CHARSET
public static final short F8EBCDIC1147_CHARSET
public static final short I8EBCDIC1144_CHARSET
public static final short WE8BS2000E_CHARSET
public static final short WE8EBCDIC1047E_CHARSET
public static final short WE8EBCDIC1140_CHARSET
public static final short WE8EBCDIC1145_CHARSET
public static final short WE8EBCDIC1146_CHARSET
public static final short WE8EBCDIC1148_CHARSET
public static final short AR8EBCDIC420S_CHARSET
public static final short IW8EBCDIC424S_CHARSET
public static final short TR8EBCDIC1026S_CHARSET
public static final short ZHT16HKSCS_CHARSET
public static final short BLT8ISO8859P13_CHARSET
public static final short AR8MSWIN1256_CHARSET
public static final short S8EBCDIC1143_CHARSET
public static final short ZHT16HKSCS31_CHARSET
public static final short AZ8ISO8859P9E_CHARSET
public static final short CEL8ISO8859P14_CHARSET
public static final short CL8ISOIR111_CHARSET
public static final short CL8KOI8U_CHARSET
public static final short WE8PC858_CHARSET
public static final short CL8EBCDIC1025C_CHARSET
public static final short CL8EBCDIC1025S_CHARSET
public static final short CL8EBCDIC1158_CHARSET
public static final short EE8EBCDIC870C_CHARSET
public static final short WE8EBCDIC924_CHARSET
public static final short WE8EBCDIC1140C_CHARSET
public static final short WE8EBCDIC1148C_CHARSET
public static final short UNICODE_2_CHARSET
public static CharacterSet make(int oracleId)
oracleId
- the number of the Oracle character set. A list of official Oracle character sets is maintained by ...public String toString()
public abstract boolean isLossyFrom(CharacterSet from)
from
- a CharacterSet being tested for compatibility with this CharacterSet.public abstract boolean isConvertibleFrom(CharacterSet source)
source
- a CharacterSet to inquire aboutpublic boolean isUnicode()
public int getOracleId()
public boolean equals(Object rhs)
public int hashCode()
public abstract String toStringWithReplacement(byte[] bytes, int offset, int count)
bytes
- a array containing characters represented in this character set.offset
- the index of the first byte or the charcterscount
- the number of bytes to be converted.public String toString(byte[] bytes, int offset, int count) throws SQLException
bytes
- a array containing characters represented in this character set.offset
- the index of the first byte or the charcterscount
- the number of bytes to be converted.SQLException
- when conversion is not supported.public abstract byte[] convert(String s) throws SQLException
SQLException
- when the oracleId does not support conversion from Unicode.SQLException
- when s contains a character that cannot be converted.public abstract byte[] convertWithReplacement(String s)
public byte[] convertWithReplacement(char[] chars, int charOffset, byte[] bytes, int byteOffset, int[] nchars)
public abstract byte[] convert(CharacterSet from, byte[] source, int offset, int count) throws SQLException
from
- the character set of the input bytessource
- an array of bytes containing the bytes to be convertedoffset
- the index of the first byte to be convertedcount
- the number of bytes to be convertedSQLException
- if the conversion is not supportedSQLException
- if some character cannot be converted. This exception is not guaranteed to be thrown. For some conversions a replacement character may be used instead.public byte[] convertUnshared(CharacterSet from, byte[] source, int offset, int count) throws SQLException
from
- the character set of the input bytessource
- an array of bytes containing the bytes to be convertedoffset
- the index of the first byte to be convertedcount
- the number of bytes to be convertedSQLException
- if the conversion is not supported.public static final String UTFToString(byte[] bytes, int offset, int nbytes, boolean useReplacementChar) throws SQLException
bytes
- containing the UTF8 stringnbytes
- of bytesuseReplacementChar
- if true invalid characters are replaced by replacement characters.SQLException
public static final String UTFToString(byte[] bytes, int offset, int nbytes) throws SQLException
bytes
- containing the UTF8 stringnbytes
- of bytesSQLException
public static final char[] UTFToJavaChar(byte[] bytes, int offset, int count) throws SQLException
bytes
- the array holding the UTF8 bytesoffset
- the index of the first bytecount
- the number of bytes in the UFT8 sequence.SQLException
- if any error occurspublic static final char[] UTFToJavaChar(byte[] bytes, int offset, int count, boolean useReplacementChar) throws SQLException
bytes
- the array holding the UTF8 bytesoffset
- the index of the first bytecount
- the number of bytes in the UFT8 sequence.useReplacementChar
- if true invalid characters are replaced by replacement characters.SQLException
- if any error occurspublic static final char[] UTFToJavaCharWithReplacement(byte[] bytes, int offset, int count)
bytes
- the array holding the UTF8 bytesoffset
- the index of the first bytecount
- the number of bytes in the UFT8 sequence.IllegalStateException
- if any error occurspublic static final int convertUTFBytesToJavaChars(byte[] bytes, int offset, char[] chars, int chars_offset, int[] countArr, boolean convertWithReplacement) throws SQLException
bytes
- the array holding the UTF8 bytesoffset
- the index of the first bytechars
- the array of holding the UTF-16 char arraychars_offset
- the idnex of the first char that will be writtencountArr
- IN/OUT parameter. countArr[0](IN) contains the number of bytes in the UTF8 sequence that need to be converted.convertWithReplacement
- set to true to use replacement character for illegal sequencesSQLException
- if invalid, illegal UTF data is givenpublic static final int convertUTFBytesToJavaChars(byte[] bytes, int offset, char[] chars, int chars_offset, int[] countArr, boolean convertWithReplacement, int charSize) throws SQLException
bytes
- the array holding the UTF8 bytesoffset
- the index of the first bytechars
- the array of holding the UTF-16 char arraychars_offset
- the idnex of the first char that will be writtencountArr
- IN/OUT parameter. countArr[0](IN) contains the number of bytes in the UTF8 sequence that need to be converted.convertWithReplacement
- set to true to use replacement character for illegal sequencesSQLException
- if invalid, illegal UTF data is givenpublic static final byte[] stringToUTF(String str)
public static final int convertJavaCharsToUTFBytes(char[] chars, int chars_offset, byte[] bytes, int bytes_begin, int chars_count)
No validation is performed.
chars
- a source string in an array of charschars_offset
- an offset to start copying in the source stringchars_count
- a length to copy from the source stringbytes
- a destination byte arraybytes_begin
- an offset to start copying in the destination byte arraypublic static final int stringUTFLength(String s)
s
- a Java stringpublic static final String AL32UTF8ToString(byte[] bytes, int offset, int nbytes)
bytes
- containing the AL32UTF8 stringoffset
- an offset to start conversionnbytes
- of bytespublic static final String AL32UTF8ToString(byte[] bytes, int offset, int nbytes, boolean useReplacementCharacter)
public static final char[] AL32UTF8ToJavaChar(byte[] bytes, int offset, int count, boolean useReplacementCharacter) throws SQLException
bytes
- an AL32UTF8 byte arrayoffset
- an offset to start conversioncount
- number of bytes to be converted.SQLException
public static final int convertAL32UTF8BytesToJavaChars(byte[] bytes, int offsetBytes, char[] chars, int offsetChars, int[] countArr, boolean convertWithReplacement) throws SQLException
bytes
- the array holding the AL32UTF8 bytesoffsetBytes
- the index of the first bytechars
- the array of holding the UTF-16 char arrayoffsetChars
- the index of the first char that will be writtencountArr
- IN/OUT parameter. countArr[0](IN) contains the number of bytes in the UTF8 sequence that need to be converted.convertWithReplacement
- set to true to use replacement character for illegal sequencesSQLException
- if invalid, illegal UTF data is givenpublic static final int convertAL32UTF8BytesToJavaChars(byte[] bytes, int offsetBytes, char[] chars, int offsetChars, int[] countArr, boolean convertWithReplacement, int charSize) throws SQLException
SQLException
public static final byte[] stringToAL32UTF8(String str)
public static final int convertJavaCharsToAL32UTF8Bytes(char[] chars, int chars_offset, byte[] bytes, int bytes_begin, int chars_count)
No validation is performed except surrogate pairs
chars
- a source string in an array of charschars_offset
- an offset to start copying in the source stringbytes
- a destination byte arraybytes_begin
- an offset to start copying in the destination byte arraychars_count
- a length to copy from the source stringpublic static final int string32UTF8Length(String s)
This method doesn't check neither invalid- nor illegal-UTF sequence.
s
- a UTF-16 string to count the number of bytes in UTF8 formatpublic static final String AL16UTF16BytesToString(byte[] bytes, int nbytes)
bytes
- containing the AL16UTF16 stringnbytes
- of bytespublic static final int AL16UTF16BytesToJavaChars(byte[] bytes, int nbytes, char[] chars)
bytes
- containing the AL16UTF16 stringnbytes
- of byteschars
- char array which the UCS2 string will be returned inpublic static final int convertAL16UTF16BytesToJavaChars(byte[] bytes, int offset, char[] chars, int chars_offset, int count, boolean convertWithReplacement) throws SQLException
bytes
- the array holding the AL16UTF16 bytesoffset
- the index of the first bytechars
- the array of holding the UTF-16 char arraychars_offset
- the index of the first charcount
- the number of bytes in the AL16UTF16 sequence.convertWithReplacement
- set to true to use replacement character for illegalSQLException
- if invalid, illegal UTF data is givenpublic static final int convertAL16UTF16LEBytesToJavaChars(byte[] bytes, int offset, char[] chars, int chars_offset, int count, boolean convertWithReplacement) throws SQLException
bytes
- the array holding the AL16UTF16LE bytesoffset
- the index of the first bytechars
- the array of holding the UTF16UTF16LE char arraychars_offset
- the index of the first charcount
- the number of bytes in the AL16UTF16LE sequence.convertWithReplacement
- set to true to use replacement character for illegalSQLException
- if invalid, illegal UTF data is givenpublic static final byte[] stringToAL16UTF16Bytes(String str)
str
- containing the UCS2 stringpublic static final int javaCharsToAL16UTF16Bytes(char[] chars, int nchars, byte[] bytes)
chars
- containing the UCS2 stringnchars
- of charsbytes
- byte array which the AL16UTF16 string will be returned inpublic static final int convertJavaCharsToAL16UTF16Bytes(char[] chars, int chars_offset, byte[] bytes, int bytes_offset, int nchars)
public static final byte[] stringToAL16UTF16LEBytes(String str)
str
- containing the UCS2 stringpublic static final int javaCharsToAL16UTF16LEBytes(char[] chars, int nchars, byte[] bytes)
chars
- containing the UCS2 stringnchars
- of charsbytes
- byte array which the AL16UTF16LE string will be returned inpublic static final int convertJavaCharsToAL16UTF16LEBytes(char[] chars, int chars_offset, byte[] bytes, int bytes_offset, int nchars)
public static final int convertASCIIBytesToJavaChars(byte[] bytes, int bytes_offset, char[] chars, int chars_offset, int count) throws SQLException
bytes
- input bytesbytes_offset
- the starting position to convertchars
- output Java char array (buffer is allocated by the caller)chars_offset
- starting position to store the Java char arraycount
- number of characters in charsSQLException
- if errors occurredpublic static final int convertJavaCharsToASCIIBytes(char[] chars, int chars_offset, byte[] bytes, int bytes_offset, int nchars) throws SQLException
chars
- input Java char arraychars_offset
- input the starting position to convertbytes
- output the converted byte array in asciibytes_offset
- input the starting position to hold the returning bytesSQLException
- if errors occurredpublic static final int convertJavaCharsToASCIIBytes(char[] chars, int chars_offset, byte[] bytes, int bytes_offset, int nchars, boolean strictConversion) throws SQLException
SQLException
public static final int convertJavaCharsToISOLATIN1Bytes(char[] chars, int chars_offset, byte[] bytes, int bytes_offset, int nchars) throws SQLException
SQLException
public static final byte[] stringToASCII(String str)
str
- input the String to be convertedpublic static final long convertUTF32toUTF16(long ucs4ch)
public int encodedByteLength(String s) throws SQLException
s
- is a Java StringSQLException
public int encodedByteLength(char[] carray)
carray
- is a char arrayprotected oracle.jdbc.internal.OracleConnection getConnectionDuringExceptionHandling()
public boolean isUnknown()