|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hsqldb.lib.StringConverter
Collection of static methods for converting strings between different formats and to and from byte arrays
Constructor Summary | |
StringConverter()
|
Method Summary | |
static String |
asciiToUnicode(byte[] s,
int offset,
int length)
Hsqldb specific decoding used only for log files. |
static String |
asciiToUnicode(String s)
|
static String |
byteToHex(byte[] b)
Converts a byte array into a hexadecimal string |
static String |
byteToString(byte[] b,
String charset)
|
static int |
getUTFSize(String s)
|
static String |
hexStringToUnicode(String s)
Converts a hex string into a byte array then converts the byte array into a Unicode string. |
static byte[] |
hexToByte(String s)
Compacts a hexadecimal string into a byte array |
static String |
inputStreamToString(InputStream x)
Using a Reader and a Writer, returns a String from an InputStream |
static String |
readUTF(byte[] bytearr,
int offset,
int length)
|
static String |
toQuotedString(String s,
char quoteChar,
boolean extraQuote)
Returns the quoted version of the string using the quotechar argument. |
static int |
unicodeToAscii(OutputStream b,
String s,
boolean doubleSingleQuotes)
Hsqldb specific encoding used only for log files. |
static String |
unicodeToHexString(String s)
Converts a Unicode string into UTF8 then convert into a hex string |
static int |
writeUTF(String str,
OutputStream out)
Writes a string to the specified DataOutput using UTF-8 encoding in a machine-independent manner. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StringConverter()
Method Detail |
public static byte[] hexToByte(String s) throws IOException
s
- hexadecimal string
IOException
public static String byteToHex(byte[] b)
b
- byte array
public static String byteToString(byte[] b, String charset)
public static String unicodeToHexString(String s)
s
- normal Unicode string
public static String hexStringToUnicode(String s) throws IOException
s
-
IOException
public static int unicodeToAscii(OutputStream b, String s, boolean doubleSingleQuotes) throws IOException
b
- output stream to wite tos
- Java Unicode string
IOException
public static String asciiToUnicode(byte[] s, int offset, int length)
s
- encoded ASCII string in byte arrayoffset
- position of first bytelength
- number of bytes to use
public static String asciiToUnicode(String s)
public static String readUTF(byte[] bytearr, int offset, int length) throws IOException
IOException
public static int writeUTF(String str, OutputStream out) throws IOException
str
- a string to be written.out
- destination to write to
IOException
- if an I/O error occurs.public static int getUTFSize(String s)
public static String inputStreamToString(InputStream x) throws IOException
IOException
public static String toQuotedString(String s, char quoteChar, boolean extraQuote)
null string argument returns null. If the caller needs the literal "NULL" it should created it itself
The reverse conversion is handled in Tokenizer.java
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |