亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? singlebytecharsetconverter.java

?? mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序
?? JAVA
字號:
/* Copyright (C) 2002-2004 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as  published by the Free Software Foundation. There are special exceptions to the terms and conditions of the GPL  as it is applied to this software. View the full text of the  exception in file EXCEPTIONS-CONNECTOR-J in the directory of this  software distribution. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */package com.mysql.jdbc;import java.io.UnsupportedEncodingException;import java.sql.SQLException;import java.util.HashMap;import java.util.Map;/** * 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 */public class SingleByteCharsetConverter {	private static final int BYTE_RANGE = (1 + Byte.MAX_VALUE) - Byte.MIN_VALUE;	private static byte[] allBytes = new byte[BYTE_RANGE];	private static final Map CONVERTER_MAP = new HashMap();	private final static byte[] EMPTY_BYTE_ARRAY = new byte[0];	// The initial charToByteMap, with all char mappings mapped	// to (byte) '?', so that unknown characters are mapped to '?'	// instead of '\0' (which means end-of-string to MySQL).	private static byte[] unknownCharsMap = new byte[65536];	static {		for (int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++) {			allBytes[i - Byte.MIN_VALUE] = (byte) i;		}		for (int i = 0; i < unknownCharsMap.length; i++) {			unknownCharsMap[i] = (byte) '?'; // use something 'sane' for												// unknown chars		}	}	// ~ Instance fields	// --------------------------------------------------------	/**	 * Get a converter for the given encoding name	 * 	 * @param encodingName	 *            the Java character encoding name	 * 	 * @return a converter for the given encoding name	 * @throws UnsupportedEncodingException	 *             if the character encoding is not supported	 */	public static synchronized SingleByteCharsetConverter getInstance(			String encodingName, Connection conn)			throws UnsupportedEncodingException, SQLException {		SingleByteCharsetConverter instance = (SingleByteCharsetConverter) CONVERTER_MAP				.get(encodingName);		if (instance == null) {			instance = initCharset(encodingName);		}		return instance;	}	/**	 * Initialize the shared instance of a converter for the given character	 * encoding.	 * 	 * @param javaEncodingName	 *            the Java name for the character set to initialize	 * @return a converter for the given character set	 * @throws UnsupportedEncodingException	 *             if the character encoding is not supported	 */	public static SingleByteCharsetConverter initCharset(String javaEncodingName)			throws UnsupportedEncodingException, SQLException {		if (CharsetMapping.isMultibyteCharset(javaEncodingName)) {			return null;		}		SingleByteCharsetConverter converter = new SingleByteCharsetConverter(				javaEncodingName);		CONVERTER_MAP.put(javaEncodingName, converter);		return converter;	}	// ~ Constructors	// -----------------------------------------------------------	/**	 * Convert the byte buffer from startPos to a length of length to a string	 * using the default platform encoding.	 * 	 * @param buffer	 *            the bytes to convert	 * @param startPos	 *            the index to start at	 * @param length	 *            the number of bytes to convert	 * @return the String representation of the given bytes	 */	public static String toStringDefaultEncoding(byte[] buffer, int startPos,			int length) {		return new String(buffer, startPos, length);	}	// ~ Methods	// ----------------------------------------------------------------	private char[] byteToChars = new char[BYTE_RANGE];	private byte[] charToByteMap = new byte[65536];	/**	 * Prevent instantiation, called out of static method initCharset().	 * 	 * @param encodingName	 *            a JVM character encoding	 * @throws UnsupportedEncodingException	 *             if the JVM does not support the encoding	 */	private SingleByteCharsetConverter(String encodingName)			throws UnsupportedEncodingException {		String allBytesString = new String(allBytes, 0, BYTE_RANGE,				encodingName);		int allBytesLen = allBytesString.length();		System.arraycopy(unknownCharsMap, 0, this.charToByteMap, 0,				this.charToByteMap.length);		for (int i = 0; i < BYTE_RANGE && i < allBytesLen; i++) {			char c = allBytesString.charAt(i);			this.byteToChars[i] = c;			this.charToByteMap[c] = allBytes[i];		}	}	public final byte[] toBytes(char[] c) {		if (c == null) {			return null;		}		int length = c.length;		byte[] bytes = new byte[length];		for (int i = 0; i < length; i++) {			bytes[i] = this.charToByteMap[c[i]];		}		return bytes;	}	public final byte[] toBytes(char[] chars, int offset, int length) {		if (chars == null) {			return null;		}		if (length == 0) {			return EMPTY_BYTE_ARRAY;		}		byte[] bytes = new byte[length];		for (int i = 0; (i < length); i++) {			bytes[i] = this.charToByteMap[chars[i + offset]];		}		return bytes;	}	/**	 * Convert the given string to an array of bytes.	 * 	 * @param s	 *            the String to convert	 * @return the bytes that make up the String	 */	public final byte[] toBytes(String s) {		if (s == null) {			return null;		}		int length = s.length();		byte[] bytes = new byte[length];		for (int i = 0; i < length; i++) {			bytes[i] = this.charToByteMap[s.charAt(i)];		}		return bytes;	}	/**	 * Convert the given string to an array of bytes.	 * 	 * @param s	 *            the String to convert	 * @param offset	 *            the offset to start at	 * @param length	 *            length (max) to convert	 * 	 * @return the bytes that make up the String	 */	public final byte[] toBytes(String s, int offset, int length) {		if (s == null) {			return null;		}		if (length == 0) {			return EMPTY_BYTE_ARRAY;		}		byte[] bytes = new byte[length];		for (int i = 0; (i < length); i++) {			char c = s.charAt(i + offset);			bytes[i] = this.charToByteMap[c];		}		return bytes;	}	/**	 * Convert the byte buffer to a string using this instance's character	 * encoding.	 * 	 * @param buffer	 *            the bytes to convert to a String	 * @return the converted String	 */	public final String toString(byte[] buffer) {		return toString(buffer, 0, buffer.length);	}	/**	 * Convert the byte buffer from startPos to a length of length to a string	 * using this instance's character encoding.	 * 	 * @param buffer	 *            the bytes to convert	 * @param startPos	 *            the index to start at	 * @param length	 *            the number of bytes to convert	 * @return the String representation of the given bytes	 */	public final String toString(byte[] buffer, int startPos, int length) {		char[] charArray = new char[length];		int readpoint = startPos;		for (int i = 0; i < length; i++) {			charArray[i] = this.byteToChars[buffer[readpoint] - Byte.MIN_VALUE];			readpoint++;		}		return new String(charArray);	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本韩国精品一区二区在线观看| 一区二区三区资源| 精品一区二区三区香蕉蜜桃| 91精品中文字幕一区二区三区| 亚洲18影院在线观看| 欧美日韩你懂的| 无码av免费一区二区三区试看 | 26uuu久久天堂性欧美| 久久成人羞羞网站| 日本一区二区三区四区在线视频| 国产精品1区2区3区| 国产午夜精品一区二区三区视频 | 亚洲午夜久久久久久久久电影院| 精品视频999| 麻豆精品视频在线观看视频| 26uuu国产在线精品一区二区| 国产91清纯白嫩初高中在线观看 | 久久先锋影音av鲁色资源网| 国产宾馆实践打屁股91| 亚洲婷婷综合色高清在线| 欧美性猛交xxxxxx富婆| 美腿丝袜亚洲色图| 中文字幕一区二区三区乱码在线| 欧美在线短视频| 国内精品伊人久久久久av影院| 国产精品视频看| 欧美人妇做爰xxxⅹ性高电影| 黄网站免费久久| 亚洲人成亚洲人成在线观看图片| 欧美区一区二区三区| 国产成人亚洲综合a∨婷婷| 椎名由奈av一区二区三区| 91麻豆精品国产自产在线观看一区| 国产剧情一区二区三区| 一区二区三区在线视频观看58| 日韩一区二区高清| 色先锋aa成人| 国产在线精品一区在线观看麻豆| 亚洲精品国产高清久久伦理二区| 日韩精品最新网址| 在线免费av一区| 国产成人综合在线| 石原莉奈在线亚洲三区| 中文字幕一区二区三区精华液 | 国产一区福利在线| 亚洲高清免费视频| 国产精品福利在线播放| 日韩亚洲欧美综合| 欧美在线小视频| 成人免费视频app| 精品一区二区在线观看| 夜夜嗨av一区二区三区网页| 国产欧美视频在线观看| 91精品国产一区二区| 色94色欧美sute亚洲线路二 | 麻豆精品国产传媒mv男同| 亚洲人吸女人奶水| 中文字幕av一区二区三区| 欧美一级国产精品| 欧美三级韩国三级日本三斤| 99这里只有久久精品视频| 国产精品一二一区| 九九精品视频在线看| 日韩av电影免费观看高清完整版在线观看| 综合色中文字幕| 国产精品视频观看| 久久综合久色欧美综合狠狠| 日韩三级精品电影久久久| 欧美在线观看视频在线| 色诱视频网站一区| 91九色02白丝porn| 色婷婷亚洲婷婷| 色狠狠一区二区| 欧美日韩综合不卡| 欧美日韩一区二区三区高清 | 99精品国产视频| voyeur盗摄精品| 91在线观看地址| 一本大道av伊人久久综合| 色呦呦国产精品| 欧美影视一区在线| 欧美日韩在线三区| 这里只有精品99re| 日韩午夜精品电影| 亚洲精品在线免费播放| 久久伊人中文字幕| 国产精品毛片大码女人| 自拍偷拍欧美激情| 一区二区三区鲁丝不卡| 亚洲国产日韩一级| 麻豆视频一区二区| 国产露脸91国语对白| 成人av在线观| 欧美影视一区在线| 精品美女在线观看| 日本一区二区免费在线| 自拍偷拍亚洲欧美日韩| 视频在线观看一区| 国产一区二区三区香蕉| 成人h精品动漫一区二区三区| 91麻豆国产在线观看| 欧美日韩国产大片| 久久综合色综合88| 亚洲欧美激情插| 日本不卡在线视频| 高清shemale亚洲人妖| 色呦呦一区二区三区| 日韩视频一区二区三区| 国产女人aaa级久久久级| 亚洲日本免费电影| 青青草原综合久久大伊人精品优势| 国产一区二区精品久久99| 本田岬高潮一区二区三区| 欧美日韩国产精选| 国产午夜精品一区二区三区视频| 日本一区二区三区在线观看| 色狠狠一区二区| 欧美色综合影院| 久久亚洲综合色一区二区三区| 国产精品美女视频| 精品福利二区三区| 成人听书哪个软件好| 亚洲综合免费观看高清完整版在线| 一区二区三区欧美| 国产成人啪免费观看软件| 91国偷自产一区二区三区成为亚洲经典 | 国产精品免费aⅴ片在线观看| 亚洲综合精品久久| 国产一区999| 欧美日韩国产在线观看| 久久新电视剧免费观看| 亚洲国产精品久久人人爱| 国产福利电影一区二区三区| 欧美日韩一区二区三区高清| 国产精品剧情在线亚洲| 久久精品国产亚洲高清剧情介绍| 91美女蜜桃在线| 国产午夜精品一区二区| 久久国内精品自在自线400部| 99久免费精品视频在线观看| 中文字幕一区二区三| 久久久影院官网| 99久精品国产| 欧美人xxxx| 一区二区三区精品视频| 国产精品99久久久久久久女警| 欧美精品tushy高清| 日韩理论电影院| 高清久久久久久| 久久午夜国产精品| 久久精品国产久精国产| 欧美久久久久久久久| 亚洲综合色视频| 色噜噜狠狠色综合欧洲selulu| 欧美激情在线一区二区三区| 久久国产精品区| 日韩欧美二区三区| 蜜桃av噜噜一区| 日韩一卡二卡三卡四卡| 肉丝袜脚交视频一区二区| 欧美性受极品xxxx喷水| 亚洲午夜视频在线观看| 色综合一个色综合亚洲| 最新日韩在线视频| 成人av电影观看| 国产精品久久精品日日| 风间由美一区二区av101| 国产视频视频一区| 国产不卡视频一区| 国产精品久久夜| 99久久精品免费观看| 亚洲人成网站影音先锋播放| 色综合色狠狠天天综合色| 亚洲欧美日韩在线不卡| 在线观看网站黄不卡| 亚洲成人免费在线| 在线播放中文字幕一区| 美女性感视频久久| 久久久亚洲精品一区二区三区| 国产精品一二二区| 国产精品成人网| 欧美性xxxxx极品少妇| 日韩不卡一区二区三区| 日韩免费一区二区| 国产一区二区免费看| 国产欧美日韩综合| 日本大香伊一区二区三区| 天天影视色香欲综合网老头| 欧美一卡二卡在线| 国产成人av资源| 亚洲免费视频成人| 91精品久久久久久久99蜜桃| 久久99国产精品久久99果冻传媒| 久久免费视频色| 91蝌蚪porny| 免费观看一级欧美片| 欧美国产日韩在线观看| 色婷婷精品久久二区二区蜜臀av | 欧美精品1区2区| 国模娜娜一区二区三区|