| java.lang.Object com.mysql.jdbc.SingleByteCharsetConverter
SingleByteCharsetConverter | public class SingleByteCharsetConverter (Code) | | Converter for char[]->byte[] and byte[]->char[] for single-byte character
sets.
Much faster (5-6x) than the built-in solution that ships with the JVM, even
with JDK-1.4.x and NewIo.
author: Mark Matthews |
Method Summary | |
public static synchronized SingleByteCharsetConverter | getInstance(String encodingName, Connection conn) | public static SingleByteCharsetConverter | initCharset(String javaEncodingName) Initialize the shared instance of a converter for the given character
encoding. | final public byte[] | toBytes(char[] c) | final public byte[] | toBytes(char[] chars, int offset, int length) | final public byte[] | toBytes(String s) Convert the given string to an array of bytes. | final public byte[] | toBytes(String s, int offset, int length) Convert the given string to an array of bytes. | final public byte[] | toBytesWrapped(char[] c, char beginWrap, char endWrap) | final public byte[] | toBytesWrapped(String s, char beginWrap, char endWrap) | final public String | toString(byte[] buffer) Convert the byte buffer to a string using this instance's character
encoding. | final public String | toString(byte[] buffer, int startPos, int length) Convert the byte buffer from startPos to a length of length to a string
using this instance's character encoding. | public static String | toStringDefaultEncoding(byte[] buffer, int startPos, int length) Convert the byte buffer from startPos to a length of length to a string
using the default platform encoding. |
toBytes | final public byte[] toBytes(char[] c)(Code) | | |
toBytes | final public byte[] toBytes(char[] chars, int offset, int length)(Code) | | |
toBytes | final public byte[] toBytes(String s)(Code) | | Convert the given string to an array of bytes.
Parameters: s - the String to convert the bytes that make up the String |
toBytes | final public byte[] toBytes(String s, int offset, int length)(Code) | | Convert the given string to an array of bytes.
Parameters: s - the String to convert Parameters: offset - the offset to start at Parameters: length - length (max) to convert the bytes that make up the String |
toBytesWrapped | final public byte[] toBytesWrapped(char[] c, char beginWrap, char endWrap)(Code) | | |
toBytesWrapped | final public byte[] toBytesWrapped(String s, char beginWrap, char endWrap)(Code) | | |
toString | final public String toString(byte[] buffer)(Code) | | Convert the byte buffer to a string using this instance's character
encoding.
Parameters: buffer - the bytes to convert to a String the converted String |
toString | final public String toString(byte[] buffer, int startPos, int length)(Code) | | Convert the byte buffer from startPos to a length of length to a string
using this instance's character encoding.
Parameters: buffer - the bytes to convert Parameters: startPos - the index to start at Parameters: length - the number of bytes to convert the String representation of the given bytes |
toStringDefaultEncoding | public static String toStringDefaultEncoding(byte[] buffer, int startPos, int length)(Code) | | Convert the byte buffer from startPos to a length of length to a string
using the default platform encoding.
Parameters: buffer - the bytes to convert Parameters: startPos - the index to start at Parameters: length - the number of bytes to convert the String representation of the given bytes |
|
|