Includes two methods based on Hypersonic code as indicated.
| Modifier and Type | Field and Description |
|---|---|
| private static final byte[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static void | |
| public static String | Returns: hex stringbyte array bytes, int number of bits bitCount)Converts a byte array into a bit string |
| public static String | Returns: hex stringbyte array b)Converts a byte array into a hexadecimal string |
| public static String | Returns: hex stringbyte array bytes, int number of bits bitCount)Converts a byte array into an SQL binary string |
| public static String | Returns: hex stringbyte array b)Converts a byte array into an SQL hexadecimal string |
| public static String | |
| pack-priv static int | |
| private static int | |
| public static int | |
| public static byte[] | Returns: byte array for the hex stringhexadecimal string s)Converts a hexadecimal string into a byte array |
| public static String | Returns: a Java stringInputStream to read from is, String character encoding of the string encoding)Using an output stream, returns a String from an InputStream. |
| public static String | |
| public static String | |
| public static BitMap | Returns: BitMap for the bit stringbit string s)Compacts a bit string into a BitMap |
| public static void | stringToHtmlBytes(HsqlByteArrayOutputStream
the output byte array output stream b, String the input string s)Converts the string to an HTML representation in the ASCII character set and appends it to a byte array output stream. |
| public static void | stringToUnicodeBytes(HsqlByteArrayOutputStream
output stream to wite to b, String Java string s, boolean boolean doubleSingleQuotes)Hsqldb specific encoding used only for log files. |
| public static String | |
| public static int | Returns: The number of bytes written out.a string to be written. str, HsqlByteArrayOutputStream destination to write to out)Writes a string to the specified DataOutput using UTF-8 encoding in a machine-independent manner. |
| public static byte[] | Returns: byte arraythe UUID string s)Returns a byte[] representation in UUID form from a UUID string. |
| public static void | |
| public static String | Returns: StringJava string s, char character used for quoting quoteChar, boolean true if quoteChar itself should be repeated extraQuote)Returns the quoted version of the string using the quotechar argument. |
| public static String | Returns: UUID string formthe byte array b)Returns a string representation in UUID form from a binary string. |
| public static String | |
| public static String | Returns: Java stringencoded ASCII string in byte array s)Hsqldb specific decoding used only for log files. |
| public static int | Returns: written countoutput array o, final int offset into output array from, byte[] input array b)Converts a byte array into hexadecimal characters which are written as ASCII to the given output stream. |
| public static int |
| HEXBYTES | back to summary |
|---|---|
| private static final byte[] HEXBYTES | |
| StringConverter | back to summary |
|---|---|
| public StringConverter() | |
| appendHex | back to summary |
|---|---|
| pack-priv static void appendHex(StringBuilder b, char c) | |
| byteArrayToBitString | back to summary |
|---|---|
| public static String byteArrayToBitString(byte[] bytes, int bitCount) Converts a byte array into a bit string
| |
| byteArrayToHexString | back to summary |
|---|---|
| public static String byteArrayToHexString(byte[] b) Converts a byte array into a hexadecimal string
| |
| byteArrayToSQLBitString | back to summary |
|---|---|
| public static String byteArrayToSQLBitString(byte[] bytes, int bitCount) Converts a byte array into an SQL binary string
| |
| byteArrayToSQLHexString | back to summary |
|---|---|
| public static String byteArrayToSQLHexString(byte[] b) Converts a byte array into an SQL hexadecimal string
| |
| byteArrayToString | back to summary |
|---|---|
| public static String byteArrayToString(byte[] b, String charset) | |
| count | back to summary |
|---|---|
| pack-priv static int count(final String s, final char c) Counts Character c in String s
| |
| getNibble | back to summary |
|---|---|
| private static int getNibble(int value) | |
| getUTFSize | back to summary |
|---|---|
| public static int getUTFSize(String s) | |
| hexStringToByteArray | back to summary |
|---|---|
| public static byte[] hexStringToByteArray(String s) throws IOException Converts a hexadecimal string into a byte array
| |
| inputStreamToString | back to summary |
|---|---|
| public static String inputStreamToString(InputStream is, String encoding) throws IOException Using an output stream, returns a String from an InputStream.
| |
| readUTF | back to summary |
|---|---|
| public static String readUTF(byte[] bytearr, int offset, int length) throws IOException | |
| readUTF | back to summary |
|---|---|
| public static String readUTF(byte[] bytearr, int offset, int length, char[] buf) throws IOException | |
| sqlBitStringToBitMap | back to summary |
|---|---|
| public static BitMap sqlBitStringToBitMap(String s) throws IOException Compacts a bit string into a BitMap
| |
| stringToHtmlBytes | back to summary |
|---|---|
| public static void stringToHtmlBytes(HsqlByteArrayOutputStream b, String s) Converts the string to an HTML representation in the ASCII character set and appends it to a byte array output stream.
| |
| stringToUnicodeBytes | back to summary |
|---|---|
| public static void stringToUnicodeBytes(HsqlByteArrayOutputStream b, String s, boolean doubleSingleQuotes) Hsqldb specific encoding used only for log files. The SQL statements that need to be written to the log file (input) are Java Unicode strings. input is converted into a 7bit escaped ASCII string (output)with the following transformations. All characters outside the 0x20-7f range are converted to an escape sequence and added to output. If a backslash character is immediately followed by 'u', the backslash character is converted to escape sequence and added to output. All the remaining characters in input are added to output without conversion. The escape sequence is backslash, letter u, xxxx, where xxxx is the hex representation of the character code. (fredt@users) Method based on Hypersonic Code
| |
| stringToUnicodeEscaped | back to summary |
|---|---|
| public static String stringToUnicodeEscaped(String s) | |
| stringToUTFBytes | back to summary |
|---|---|
| public static int stringToUTFBytes(String str, HsqlByteArrayOutputStream out) Writes a string to the specified DataOutput using UTF-8 encoding in a machine-independent manner.
| |
| toBinaryUUID | back to summary |
|---|---|
| public static byte[] toBinaryUUID(String s) Returns a byte[] representation in UUID form from a UUID string.
| |
| toJSONString | back to summary |
|---|---|
| public static void toJSONString(String s, StringBuilder sb) | |
| toQuotedString | back to summary |
|---|---|
| public static String toQuotedString(String s, char quoteChar, boolean extraQuote) Returns the quoted version of the string using the quotechar argument. doublequote argument indicates whether each instance of quotechar inside the string is doubled. null string argument returns null. If the caller needs the literal "NULL" it should be created it itself
| |
| toStringUUID | back to summary |
|---|---|
| public static String toStringUUID(byte[] b) Returns a string representation in UUID form from a binary string. UUID string is composed of 8-4-4-4-12 hexadecimal characters.
| |
| unicodeEscapedToString | back to summary |
|---|---|
| public static String unicodeEscapedToString(String s) throws IOException | |
| unicodeStringToString | back to summary |
|---|---|
| public static String unicodeStringToString(String s) Hsqldb specific decoding used only for log files. This method converts the 7 bit escaped ASCII strings in a log file back into Java Unicode strings. See stringToUnicodeBytes() above. Method based on Hypersonic Code | |
| writeHexBytes | back to summary |
|---|---|
| public static int writeHexBytes(byte[] o, final int from, byte[] b) Converts a byte array into hexadecimal characters which are written as ASCII to the given output stream.
| |
| writeUUIDHexBytes | back to summary |
|---|---|
| public static int writeUUIDHexBytes(byte[] o, final int from, byte[] b) | |