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

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

?? stringutils.java

?? Jive論壇2.5版本的源程序
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
            ret.append(cvt.charAt(c));
            c = (data[i] << 4) & 0x3f;
            if (++i < len)
                c |= (data[i] >> 4) & 0x0f;

            ret.append(cvt.charAt(c));
            if (i < len) {
                c = (data[i] << 2) & 0x3f;
                if (++i < len)
                    c |= (data[i] >> 6) & 0x03;

                ret.append(cvt.charAt(c));
            }
            else {
                ++i;
                ret.append((char) fillchar);
            }

            if (i < len) {
                c = data[i] & 0x3f;
                ret.append(cvt.charAt(c));
            }
            else {
                ret.append((char) fillchar);
            }
        }
        return ret.toString();
    }

    /**
     * Decodes a base64 String.
     *
     * @param data a base64 encoded String to decode.
     * @return the decoded String.
     */
    public static String decodeBase64(String data) {
        return decodeBase64(data.getBytes());
    }

    /**
     * Decodes a base64 aray of bytes.
     *
     * @param data a base64 encode byte array to decode.
     * @return the decoded String.
     */
    public static String decodeBase64(byte[] data) {
        int c, c1;
        int len = data.length;
        StringBuffer ret = new StringBuffer((len * 3) / 4);
        for (int i = 0; i < len; ++i) {
            c = cvt.indexOf(data[i]);
            ++i;
            c1 = cvt.indexOf(data[i]);
            c = ((c << 2) | ((c1 >> 4) & 0x3));
            ret.append((char) c);
            if (++i < len) {
                c = data[i];
                if (fillchar == c)
                    break;

                c = cvt.indexOf((char) c);
                c1 = ((c1 << 4) & 0xf0) | ((c >> 2) & 0xf);
                ret.append((char) c1);
            }

            if (++i < len) {
                c1 = data[i];
                if (fillchar == c1)
                    break;

                c1 = cvt.indexOf((char) c1);
                c = ((c << 6) & 0xc0) | c1;
                ret.append((char) c);
            }
        }
        return ret.toString();
    }

    private static final int fillchar = '=';
    private static final String cvt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                                    + "abcdefghijklmnopqrstuvwxyz"
                                    + "0123456789+/";

    /**
     * Converts a line of text into an array of lower case words using a
     * BreakIterator.wordInstance(). <p>
     *
     * This method is under the Jive Open Source Software License and was
     * written by Mark Imbriaco.
     *
     * @param text a String of text to convert into an array of words
     * @return text broken up into an array of words.
     */
    public static final String [] toLowerCaseWordArray(String text) {
        if (text == null || text.length() == 0) {
                return new String[0];
        }

        ArrayList wordList = new ArrayList();
        BreakIterator boundary = BreakIterator.getWordInstance();
        boundary.setText(text);
        int start = 0;

        for (int end = boundary.next(); end != BreakIterator.DONE;
                start = end, end = boundary.next())
        {
            String tmp = text.substring(start,end).trim();
            // Remove characters that are not needed.
            tmp = replace(tmp, "+", "");
            tmp = replace(tmp, "/", "");
            tmp = replace(tmp, "\\", "");
            tmp = replace(tmp, "#", "");
            tmp = replace(tmp, "*", "");
            tmp = replace(tmp, ")", "");
            tmp = replace(tmp, "(", "");
            tmp = replace(tmp, "&", "");
            if (tmp.length() > 0) {
                wordList.add(tmp);
            }
        }
        return (String[]) wordList.toArray(new String[wordList.size()]);
    }

    /**
     * Pseudo-random number generator object for use with randomString().
     * The Random class is not considered to be cryptographically secure, so
     * only use these random Strings for low to medium security applications.
     */
    private static Random randGen = new Random();

    /**
     * Array of numbers and letters of mixed case. Numbers appear in the list
     * twice so that there is a more equal chance that a number will be picked.
     * We can use the array to get a random number or letter by picking a random
     * array index.
     */
    private static char[] numbersAndLetters = ("0123456789abcdefghijklmnopqrstuvwxyz" +
                    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ").toCharArray();

    /**
     * Returns a random String of numbers and letters (lower and upper case)
     * of the specified length. The method uses the Random class that is
     * built-in to Java which is suitable for low to medium grade security uses.
     * This means that the output is only pseudo random, i.e., each number is
     * mathematically generated so is not truly random.<p>
     *
     * The specified length must be at least one. If not, the method will return
     * null.
     *
     * @param length the desired length of the random String to return.
     * @return a random String of numbers and letters of the specified length.
     */
    public static final String randomString(int length) {
        if (length < 1) {
            return null;
        }
        // Create a char buffer to put random letters and numbers in.
        char [] randBuffer = new char[length];
        for (int i=0; i<randBuffer.length; i++) {
            randBuffer[i] = numbersAndLetters[randGen.nextInt(71)];
        }
        return new String(randBuffer);
    }

   /**
    * Intelligently chops a String at a word boundary (whitespace) that occurs
    * at the specified index in the argument or before. However, if there is a
    * newline character before <code>length</code>, the String will be chopped
    * there. If no newline or whitespace is found in <code>string</code> up to
    * the index <code>length</code>, the String will chopped at <code>length</code>.
    * <p>
    * For example, chopAtWord("This is a nice String", 10) will return
    * "This is a" which is the first word boundary less than or equal to 10
    * characters into the original String.
    *
    * @param string the String to chop.
    * @param length the index in <code>string</code> to start looking for a
    *       whitespace boundary at.
    * @return a substring of <code>string</code> whose length is less than or
    *       equal to <code>length</code>, and that is chopped at whitespace.
    */
    public static final String chopAtWord(String string, int length) {
        if (string == null) {
            return string;
        }

        char [] charArray = string.toCharArray();
        int sLength = string.length();
        if (length < sLength) {
            sLength = length;
        }

        // First check if there is a newline character before length; if so,
        // chop word there.
        for (int i=0; i<sLength-1; i++) {
            // Windows
            if (charArray[i] == '\r' && charArray[i+1] == '\n') {
                return string.substring(0, i+1);
            }
            // Unix
            else if (charArray[i] == '\n') {
                return string.substring(0, i);
            }
        }
        // Also check boundary case of Unix newline
        if (charArray[sLength-1] == '\n') {
            return string.substring(0, sLength-1);
        }

        // Done checking for newline, now see if the total string is less than
        // the specified chop point.
        if (string.length() < length) {
            return string;
        }

        // No newline, so chop at the first whitespace.
        for (int i = length-1; i > 0; i--) {
            if (charArray[i] == ' ') {
                return string.substring(0, i).trim();
            }
        }

        // Did not find word boundary so return original String chopped at
        // specified length.
        return string.substring(0, length);
    }

    // Create a regular expression engine that is used by the highlightWords
    // method below.
    private static Perl5Util perl5Util = new Perl5Util();

    /**
     * Highlights words in a string. Words matching ignores case. The actual
     * higlighting method is specified with the start and end higlight tags.
     * Those might be beginning and ending HTML bold tags, or anything else.<p>
     *
     * This method is under the Jive Open Source Software License and was
     * written by Mark Imbriaco.
     *
     * @param string the String to highlight words in.
     * @param words an array of words that should be highlighted in the string.
     * @param startHighlight the tag that should be inserted to start highlighting.
     * @param endHighlight the tag that should be inserted to end highlighting.
     * @return a new String with the specified words highlighted.
     */
    public static final String highlightWords(String string, String[] words,
        String startHighlight, String endHighlight)
    {
        if (string == null || words == null ||
                startHighlight == null || endHighlight == null)
        {
            return null;
        }

        StringBuffer regexp = new StringBuffer();

        // Iterate through each word and generate a word list for the regexp.
        for (int x=0; x<words.length; x++)
        {
            // Excape "|" and "/"  to keep us out of trouble in our regexp.
            words[x] = perl5Util.substitute("s#([\\|\\/\\.])#\\\\$1#g", words[x]);
            if (regexp.length() > 0)
            {
                regexp.append("|");
            }
            regexp.append(words[x]);
        }

        // Escape the regular expression delimiter ("/").
        startHighlight = perl5Util.substitute("s#\\/#\\\\/#g", startHighlight);
        endHighlight = perl5Util.substitute("s#\\/#\\\\/#g", endHighlight);

        // Build the regular expression. insert() the first part.
        regexp.insert(0, "s/\\b(");
        // The word list is here already, so just append the rest.
        regexp.append(")\\b/");
        regexp.append(startHighlight);
        regexp.append("$1");
        regexp.append(endHighlight);
        regexp.append("/igm");

        // Do the actual substitution via a simple regular expression.
        return perl5Util.substitute(regexp.toString(), string);
    }

    /**
     * Escapes all necessary characters in the String so that it can be used
     * in an XML doc.
     *
     * @param string the string to escape.
     * @return the string with appropriate characters escaped.
     */
    public static final String escapeForXML(String string) {
        if (string == null) {
            return null;
        }
        char ch;
        int i=0;
        int last=0;
        char[] input = string.toCharArray();
        int len = input.length;
        StringBuffer out = new StringBuffer((int)(len*1.3));
        for (; i < len; i++) {
            ch = input[i];
            if (ch > '>') {
                continue;
            } else if (ch == '<') {
                if (i > last) {
                    out.append(input, last, i - last);
                }
                last = i + 1;
                out.append(LT_ENCODE);
            } else if (ch == '&') {
                if (i > last) {
                    out.append(input, last, i - last);
                }
                last = i + 1;
                out.append(AMP_ENCODE);
            } else if (ch == '"') {
                if (i > last) {
                    out.append(input, last, i - last);
                }
                last = i + 1;
                out.append(QUOTE_ENCODE);
            }
        }
        if (last == 0) {
            return string;
        }
        if (i > last) {
            out.append(input, last, i - last);
        }
        return out.toString();
    }

    /**
     * Unescapes the String by converting XML escape sequences back into normal
     * characters.
     *
     * @param string the string to unescape.
     * @return the string with appropriate characters unescaped.
     */
    public static final String unescapeFromXML(String string) {
        string = replace(string, "&lt;", "<");
        string = replace(string, "&gt;", ">");
        string = replace(string, "&quot;", "\"");
        return replace(string, "&amp;", "&");
    }

    private static final char[] zeroArray = "0000000000000000".toCharArray();

    /**
     * Pads the supplied String with 0's to the specified length and returns
     * the result as a new String. For example, if the initial String is
     * "9999" and the desired length is 8, the result would be "00009999".
     * This type of padding is useful for creating numerical values that need
     * to be stored and sorted as character data. Note: the current
     * implementation of this method allows for a maximum <tt>length</tt> of
     * 16.
     *
     * @param string the original String to pad.
     * @param length the desired length of the new padded String.
     * @return a new String padded with the required number of 0's.
     */
     public static final String zeroPadString(String string, int length) {
        if (string == null || string.length() > length) {
            return string;
        }
        StringBuffer buf = new StringBuffer(length);
        buf.append(zeroArray, 0, length-string.length()).append(string);
        return buf.toString();
     }

     /**
      * Formats a Date as a fifteen character long String made up of the Date's
      * padded millisecond value.
      *
      * @return a Date encoded as a String.
      */
     public static final String dateToMillis(Date date) {
        return zeroPadString(Long.toString(date.getTime()), 15);
     }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产69精品一区二区亚洲孕妇| 天堂影院一区二区| 国产**成人网毛片九色| 国产一区二区在线观看视频| 97精品视频在线观看自产线路二| 91精品国产aⅴ一区二区| 国产精品视频麻豆| 捆绑调教美女网站视频一区| 欧美日韩一级二级| 中文字幕中文字幕在线一区 | 视频一区二区中文字幕| 成人不卡免费av| 日韩你懂的在线观看| 尤物在线观看一区| 成人av网站在线观看| 亚洲国产精品久久人人爱蜜臀 | 亚洲靠逼com| 亚洲精品欧美专区| 午夜精品福利久久久| 麻豆精品视频在线观看| 国产精品一区二区在线播放| 成人免费的视频| 91免费看`日韩一区二区| 欧美日韩精品一区二区在线播放 | 成人午夜av在线| 一本大道久久a久久精二百| 欧美视频三区在线播放| 日韩一区二区在线看片| 国产精品美女久久久久aⅴ| 一区二区三区日韩欧美| 麻豆精品在线播放| 色综合色狠狠天天综合色| 7777女厕盗摄久久久| 久久久精品综合| 亚洲五月六月丁香激情| 国产乱码精品一品二品| 在线免费观看日韩欧美| 精品国产免费视频| 亚洲色图另类专区| 毛片一区二区三区| 欧美日韩在线观看一区二区| 国产拍欧美日韩视频二区| 亚洲成在人线免费| 成人免费高清在线观看| 欧美成人国产一区二区| 亚洲狠狠爱一区二区三区| 国产精品一区一区三区| 欧美一区二区三区公司| 亚洲欧洲日韩一区二区三区| 久久se精品一区精品二区| 色菇凉天天综合网| 久久久久久久久伊人| 日本人妖一区二区| 在线亚洲+欧美+日本专区| 久久精品一区二区三区不卡| 久久女同性恋中文字幕| av中文一区二区三区| 亚洲国产综合视频在线观看| 日韩久久免费av| 成人午夜激情视频| 五月天欧美精品| 亚洲精品一区二区三区蜜桃下载 | 日本一区二区三区视频视频| 色狠狠一区二区| 久久精工是国产品牌吗| 中文字幕乱码亚洲精品一区| 欧美性受xxxx黑人xyx| 精品一区二区三区久久久| 国产精品高清亚洲| 日韩一区二区在线看| 91在线免费播放| 亚洲国产一区视频| 91国产丝袜在线播放| 欧美www视频| 精品一区二区三区日韩| 精品国产露脸精彩对白| 黑人巨大精品欧美黑白配亚洲| 欧美一区二区免费| 麻豆久久久久久| 久久久久国产精品麻豆ai换脸| 国产精品中文字幕欧美| 国产精品网站在线播放| 成人高清视频在线| 亚洲免费观看高清完整| 91国偷自产一区二区开放时间 | 美女性感视频久久| 欧美一级二级三级蜜桃| 久久99精品久久久久久国产越南 | 国产精品久久久久久久久动漫 | 久久99精品久久久久婷婷| 欧美大度的电影原声| 韩国av一区二区三区四区| 久久精品免费在线观看| 丁香婷婷综合五月| 亚洲一区二区美女| 日韩精品在线看片z| 国产麻豆91精品| 亚洲婷婷综合色高清在线| 在线亚洲+欧美+日本专区| 麻豆专区一区二区三区四区五区| 久久久久久久久久美女| 97久久精品人人做人人爽| 日韩综合小视频| 久久精品一区八戒影视| 欧美在线观看18| 蜜臀av性久久久久蜜臀aⅴ| 国产香蕉久久精品综合网| 99re在线精品| 免费成人在线视频观看| 中文字幕免费一区| 91精品国产乱码久久蜜臀| 成人黄页毛片网站| 日本欧美大码aⅴ在线播放| 国产亲近乱来精品视频| 欧美三级蜜桃2在线观看| 国产又黄又大久久| 亚洲成人自拍一区| 中文字幕精品一区二区精品绿巨人 | 精品国产乱码久久久久久图片| 成人免费毛片aaaaa**| 欧美日韩一区国产| 亚洲欧洲另类国产综合| 午夜精品福利视频网站| 99精品视频在线观看| 欧洲一区在线电影| 欧美亚一区二区| 国产成人一区在线| 麻豆精品在线播放| 欧美性受xxxx黑人xyx| 福利91精品一区二区三区| 视频一区国产视频| 亚洲精品国产无套在线观| 久久亚洲综合色一区二区三区| 成人一级黄色片| 麻豆视频一区二区| 日韩成人免费电影| 一区二区不卡在线视频 午夜欧美不卡在| 日韩午夜精品电影| 欧美日韩国产一级二级| 色综合欧美在线视频区| 成av人片一区二区| 国产福利一区二区三区视频| 蜜臀av性久久久久蜜臀aⅴ流畅 | 精一区二区三区| 日欧美一区二区| 视频一区二区不卡| 亚洲成av人在线观看| 亚洲嫩草精品久久| 日韩毛片高清在线播放| 国产精品国产a级| 亚洲欧洲无码一区二区三区| 国产精品久线观看视频| 中文av一区二区| 国产欧美一区二区三区在线老狼| 精品国产91九色蝌蚪| 欧美大胆人体bbbb| 久久综合色一综合色88| 久久蜜桃香蕉精品一区二区三区| 精品99999| 国产亚洲欧美色| 国产欧美一区二区三区沐欲| 国产日本欧美一区二区| 日本一区二区三区dvd视频在线| 久久综合九色综合97婷婷女人| 精品国产免费久久| 欧美国产日韩在线观看| 国产精品久久二区二区| 亚洲激情成人在线| 天堂蜜桃91精品| 国产在线一区观看| 成人性生交大合| 色欧美乱欧美15图片| 在线成人小视频| 久久蜜臀中文字幕| 亚洲欧美日韩电影| 日韩成人一级大片| 国产一区不卡在线| 97se狠狠狠综合亚洲狠狠| 欧美日韩中字一区| 久久午夜电影网| 夜夜爽夜夜爽精品视频| 人人狠狠综合久久亚洲| 国产成人午夜精品影院观看视频| 成人av网站在线| 7777女厕盗摄久久久| 欧美韩国一区二区| 日韩成人午夜精品| 99久久99久久综合| 欧美一区永久视频免费观看| 精品国产免费一区二区三区四区 | 亚洲卡通动漫在线| 精品一区二区免费看| 色婷婷狠狠综合| 久久先锋资源网| 图片区小说区区亚洲影院| 国产精品伊人色| 欧美一区二区三区啪啪| 亚洲免费伊人电影| 国产在线播放一区三区四| 欧美日韩中文一区|