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

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

?? stringutils.java

?? jsp數據庫系統
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
   Copyright (C) 2002 MySQL AB

      This program is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published by
      the Free Software Foundation; either version 2 of the License, or
      (at your option) any later version.

      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.ByteArrayOutputStream;
import java.io.UnsupportedEncodingException;

import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;


/**
 * Various utility methods for converting to/from byte arrays in the platform
 * encoding
 *
 * @author Mark Matthews
 */
public class StringUtils {
    private static final int BYTE_RANGE = (1 + Byte.MAX_VALUE) - Byte.MIN_VALUE;
    private static byte[] allBytes = new byte[BYTE_RANGE];
    private static char[] byteToChars = new char[BYTE_RANGE];

    static {
        for (int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++) {
            allBytes[i - Byte.MIN_VALUE] = (byte) i;
        }

        String allBytesString = new String(allBytes, 0,
                Byte.MAX_VALUE - Byte.MIN_VALUE);

        int allBytesStringLen = allBytesString.length();

        for (int i = 0;
                (i < (Byte.MAX_VALUE - Byte.MIN_VALUE))
                && (i < allBytesStringLen); i++) {
            byteToChars[i] = allBytesString.charAt(i);
        }
    }

    /**
     * Returns the byte[] representation of the given string using given
     * encoding.
     *
     * @param s the string to convert
     * @param encoding the character encoding to use
     *
     * @return byte[] representation of the string
     *
     * @throws UnsupportedEncodingException if an encoding unsupported by the
     *         JVM is supplied.
     */
    public static final byte[] getBytes(String s, String encoding)
        throws UnsupportedEncodingException {
        SingleByteCharsetConverter converter = SingleByteCharsetConverter
            .getInstance(encoding);

        return getBytes(s, converter, encoding);
    }

    /**
     * Returns the byte[] representation of the given string (re)using the
     * given charset converter, and the given encoding.
     *
     * @param s the string to convert
     * @param converter the converter to reuse
     * @param encoding the character encoding to use
     *
     * @return byte[] representation of the string
     *
     * @throws UnsupportedEncodingException if an encoding unsupported by the
     *         JVM is supplied.
     */
    public static final byte[] getBytes(String s,
        SingleByteCharsetConverter converter, String encoding)
        throws UnsupportedEncodingException {
        byte[] b = null;

        if (converter != null) {
            b = converter.toBytes(s);
        } else if (encoding == null) {
            b = s.getBytes();
        } else {
            b = s.getBytes(encoding);

            if (encoding.equalsIgnoreCase("SJIS")
                    || encoding.equalsIgnoreCase("BIG5")
                    || encoding.equalsIgnoreCase("GBK")) {
                b = escapeSJISByteStream(b, s, 0, s.length());
            }
        }

        return b;
    }

    /**
     * DOCUMENT ME!
     *
     * @param s DOCUMENT ME!
     * @param converter DOCUMENT ME!
     * @param encoding DOCUMENT ME!
     * @param offset DOCUMENT ME!
     * @param length DOCUMENT ME!
     *
     * @return DOCUMENT ME!
     *
     * @throws UnsupportedEncodingException DOCUMENT ME!
     */
    public static final byte[] getBytes(String s,
        SingleByteCharsetConverter converter, String encoding, int offset,
        int length) throws UnsupportedEncodingException {
        byte[] b = null;

        if (converter != null) {
            b = converter.toBytes(s, offset, length);
        } else if (encoding == null) {
            byte[] temp = s.getBytes();

            b = new byte[length];
            System.arraycopy(temp, offset, b, 0, length);
        } else {
            byte[] temp = s.getBytes(encoding);

            b = new byte[length];
            System.arraycopy(temp, offset, b, 0, length);

            if (encoding.equalsIgnoreCase("SJIS")
                    || encoding.equalsIgnoreCase("BIG5")
                    || encoding.equalsIgnoreCase("GBK")) {
                b = escapeSJISByteStream(b, s, offset, length);
            }
        }

        return b;
    }

    /**
     * Dumps the given bytes to STDOUT as a hex dump (up to length bytes).
     *
     * @param byteBuffer the data to print as hex
     * @param length the number of bytes to print
     */
    public static final void dumpAsHex(byte[] byteBuffer, int length) {
        int p = 0;
        int rows = length / 8;

        for (int i = 0; i < rows; i++) {
            int ptemp = p;

            for (int j = 0; j < 8; j++) {
                String hexVal = Integer.toHexString((int) byteBuffer[ptemp]
                        & 0xff);

                if (hexVal.length() == 1) {
                    hexVal = "0" + hexVal;
                }

                System.out.print(hexVal + " ");
                ptemp++;
            }

            System.out.print("    ");

            for (int j = 0; j < 8; j++) {
                if ((byteBuffer[p] > 32) && (byteBuffer[p] < 127)) {
                    System.out.print((char) byteBuffer[p] + " ");
                } else {
                    System.out.print(". ");
                }

                p++;
            }

            System.out.println();
        }

        int n = 0;

        for (int i = p; i < length; i++) {
            String hexVal = Integer.toHexString((int) byteBuffer[i] & 0xff);

            if (hexVal.length() == 1) {
                hexVal = "0" + hexVal;
            }

            System.out.print(hexVal + " ");
            n++;
        }

        for (int i = n; i < 8; i++) {
            System.out.print("   ");
        }

        System.out.print("    ");

        for (int i = p; i < length; i++) {
            if ((byteBuffer[i] > 32) && (byteBuffer[i] < 127)) {
                System.out.print((char) byteBuffer[i] + " ");
            } else {
                System.out.print(". ");
            }
        }

        System.out.println();
    }

    /**
     * Returns the bytes as an ASCII String.
     *
     * @param buffer the bytes representing the string
     *
     * @return The ASCII String.
     */
    public static final String toAsciiString(byte[] buffer) {
        return toAsciiString(buffer, 0, buffer.length);
    }

    /**
     * Returns the bytes as an ASCII String.
     *
     * @param buffer the bytes to convert
     * @param startPos the position to start converting
     * @param length the length of the string to convert
     *
     * @return the ASCII string
     */
    public static final String toAsciiString(byte[] buffer, int startPos,
        int length) {
        char[] charArray = new char[length];
        int readpoint = startPos;

        for (int i = 0; i < length; i++) {
            charArray[i] = (char) buffer[readpoint];
            readpoint++;
        }

        return new String(charArray);
    }

    /**
     * Unfortunately, SJIS has 0x5c as a high byte in some of its double-byte
     * characters, so we need to escape it.
     *
     * @param origBytes the original bytes in SJIS format
     * @param origString the string that had .getBytes() called on it
     * @param offset where to start converting from
     * @param length how many characters to convert.
     *
     * @return byte[] with 0x5c escaped
     */
    public static byte[] escapeSJISByteStream(byte[] origBytes,
        String origString, int offset, int length) {
        if ((origBytes == null) || (origBytes.length == 0)) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99re6这里只有精品视频在线观看| 国产精品系列在线观看| 99久久99久久免费精品蜜臀| 国产精品久久久久久户外露出| 国产福利一区二区三区视频 | 久久99久久99小草精品免视看| 欧美亚洲综合一区| 蜜桃一区二区三区四区| 久久精品视频在线免费观看| 97se狠狠狠综合亚洲狠狠| 一区二区三区.www| 精品国产乱码久久久久久久久| 国产一区二区三区免费看| 亚洲四区在线观看| 欧美成人精品3d动漫h| 91同城在线观看| 黄一区二区三区| 欧美在线免费观看亚洲| 日本欧美久久久久免费播放网| 中文字幕乱码久久午夜不卡 | 欧美日韩国产精品自在自线| 亚洲精品高清在线| 欧美大白屁股肥臀xxxxxx| 日韩高清不卡一区二区| 亚洲免费观看高清完整版在线观看熊 | 99视频国产精品| 日本不卡的三区四区五区| 亚洲色图欧洲色图| 国产精品久久影院| 久久免费视频一区| 日韩免费视频一区二区| 在线成人av网站| 欧美视频一区在线观看| 日本精品一级二级| 色一情一乱一乱一91av| 91色porny蝌蚪| 91蜜桃婷婷狠狠久久综合9色| 成人av动漫在线| 成人激情动漫在线观看| 91丨九色丨黑人外教| 色婷婷久久久综合中文字幕| 色94色欧美sute亚洲线路一久 | 久久久综合激的五月天| 日韩视频一区二区三区在线播放| 色哟哟精品一区| 不卡电影一区二区三区| 97精品超碰一区二区三区| 97久久精品人人做人人爽| 成人免费观看av| 91麻豆精品国产91| 久久久久久久久岛国免费| 亚洲人123区| 日本不卡视频一二三区| 成人免费看片app下载| 91国产精品成人| 国产欧美一区二区三区在线看蜜臀 | 色综合久久天天| 精品国产免费人成在线观看| 中文字幕一区二| 日本网站在线观看一区二区三区| 国产美女精品人人做人人爽| 色综合久久久久网| 久久久九九九九| 久久国产精品第一页| 欧美综合一区二区三区| 国产精品欧美久久久久一区二区| 国产精品久久久久永久免费观看| 丝袜诱惑亚洲看片| 欧美日韩国产在线播放网站| 国产精品传媒视频| 粉嫩在线一区二区三区视频| 欧美一区二区三区男人的天堂| 国产精品成人免费| 风间由美性色一区二区三区| 国产喷白浆一区二区三区| 久草在线在线精品观看| 精品少妇一区二区三区免费观看 | 欧美成人一区二区三区片免费| 亚洲精品国产a| 91传媒视频在线播放| 一区二区久久久久久| 91黄色小视频| 日日夜夜精品视频免费| 欧美丰满一区二区免费视频| 日本中文字幕一区二区有限公司| 欧美色欧美亚洲另类二区| 一区二区三区精品视频在线| 97精品国产露脸对白| 亚洲欧美一区二区久久 | 欧美日韩中文精品| 午夜成人在线视频| 久久蜜桃香蕉精品一区二区三区| 国产成人在线免费观看| 亚洲欧洲精品一区二区三区不卡| 91传媒视频在线播放| 麻豆一区二区在线| 亚洲色图在线视频| 26uuu久久天堂性欧美| 91免费精品国自产拍在线不卡| 亚洲精品免费在线观看| 日韩精品专区在线影院重磅| 国产精品一区二区久久精品爱涩| 1区2区3区欧美| 精品福利视频一区二区三区| 91麻豆免费看| 成人av在线影院| 久久99精品久久久久久动态图| 亚洲免费视频成人| 国产午夜精品福利| 精品电影一区二区三区| 欧美精三区欧美精三区| 成人夜色视频网站在线观看| 麻豆国产欧美日韩综合精品二区| 亚洲男同性恋视频| 亚洲视频在线观看一区| 国产蜜臀av在线一区二区三区| 日韩欧美激情四射| 日韩亚洲欧美成人一区| 日韩精品中文字幕一区二区三区 | 国产成人精品影视| 国产精品一区二区在线观看网站| 狠狠色综合播放一区二区| 秋霞国产午夜精品免费视频| 日本美女一区二区三区视频| 日韩和欧美一区二区三区| 奇米色777欧美一区二区| 伦理电影国产精品| 国产麻豆欧美日韩一区| 成人午夜激情片| 在线观看一区二区视频| 欧美午夜精品理论片a级按摩| 欧美日韩激情一区二区| 欧美一级高清片在线观看| 欧美军同video69gay| 日韩欧美国产不卡| 国产精品进线69影院| 亚洲一区二区中文在线| 日本美女一区二区三区视频| 国产福利91精品一区二区三区| 91在线视频免费观看| 51精品久久久久久久蜜臀| 国产三级欧美三级日产三级99| 国产精品久久二区二区| 男女性色大片免费观看一区二区| 精品一区二区免费看| 欧美日韩久久久一区| 国产片一区二区| 国产一区二区三区免费看| 欧美日产国产精品| 国产精品高潮呻吟久久| 久久99精品国产麻豆婷婷| 欧美高清www午色夜在线视频| 91麻豆高清视频| 另类调教123区 | 免费在线看一区| 一本色道久久综合亚洲精品按摩| 精品久久久三级丝袜| 亚洲一级电影视频| 色综合天天天天做夜夜夜夜做| 99久久精品国产导航| 国产精品视频一二三区| 国产在线乱码一区二区三区| 久久青草欧美一区二区三区| 老色鬼精品视频在线观看播放| 欧美日韩国产a| 青青草97国产精品免费观看无弹窗版| 欧美日韩亚洲高清一区二区| 亚洲欧美日韩一区| 欧美日韩的一区二区| 蜜桃一区二区三区在线观看| 欧美极品少妇xxxxⅹ高跟鞋| 成人美女视频在线看| 亚洲综合无码一区二区| 884aa四虎影成人精品一区| 日韩精品欧美成人高清一区二区| 欧美精品乱人伦久久久久久| 国产在线不卡一区| 国产精品美女久久久久久久久| 91蜜桃在线观看| 免费在线视频一区| 国产精品乱码人人做人人爱| 欧美日韩在线播放| 国产成人av影院| 天天射综合影视| 最新欧美精品一区二区三区| 欧美一区二区大片| 欧洲另类一二三四区| 国产自产视频一区二区三区| 亚洲地区一二三色| 亚洲欧美一区二区三区孕妇| 精品美女在线播放| 欧美午夜在线观看| 色综合久久九月婷婷色综合| 国产成人自拍网| 极品美女销魂一区二区三区| 亚洲国产精品久久人人爱蜜臀| 欧美国产欧美亚州国产日韩mv天天看完整 | 91丨九色丨国产丨porny| 国内精品不卡在线| 久久精品久久综合|