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

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

?? utf8.java

?? Hadoop是一個用于運行應用程序在大型集群的廉價硬件設備上的框架。Hadoop為應用程序透明的提供了一組穩定/可靠的接口和數據運動。在 Hadoop中實現了Google的MapReduce算法
?? JAVA
字號:
/** * Copyright 2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *     http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package org.apache.hadoop.io;import java.io.IOException;import java.io.DataInput;import java.io.DataOutput;import java.util.logging.Logger;import org.apache.hadoop.util.LogFormatter;/** A WritableComparable for strings that uses the UTF8 encoding. *  * <p>Also includes utilities for efficiently reading and writing UTF-8. * * @author Doug Cutting */public class UTF8 implements WritableComparable {  private static final Logger LOG= LogFormatter.getLogger("org.apache.hadoop.io.UTF8");  private static final DataOutputBuffer OBUF = new DataOutputBuffer();  private static final DataInputBuffer IBUF = new DataInputBuffer();  private static final byte[] EMPTY_BYTES = new byte[0];  private byte[] bytes = EMPTY_BYTES;  private int length;  public UTF8() {    //set("");  }  /** Construct from a given string. */  public UTF8(String string) {    set(string);  }  /** Construct from a given string. */  public UTF8(UTF8 utf8) {    set(utf8);  }  /** The raw bytes. */  public byte[] getBytes() {    return bytes;  }  /** The number of bytes in the encoded string. */  public int getLength() {    return length;  }  /** Set to contain the contents of a string. */  public void set(String string) {    if (string.length() > 0xffff/3) {             // maybe too long      LOG.warning("truncating long string: " + string.length()                  + " chars, starting with " + string.substring(0, 20));      string = string.substring(0, 0xffff/3);    }    length = utf8Length(string);                  // compute length    if (length > 0xffff)                          // double-check length      throw new RuntimeException("string too long!");    if (bytes == null || length > bytes.length)   // grow buffer      bytes = new byte[length];    try {                                         // avoid sync'd allocations      synchronized (OBUF) {        OBUF.reset();        writeChars(OBUF, string, 0, string.length());        System.arraycopy(OBUF.getData(), 0, bytes, 0, length);      }    } catch (IOException e) {      throw new RuntimeException(e);    }  }  /** Set to contain the contents of a string. */  public void set(UTF8 other) {    length = other.length;    if (bytes == null || length > bytes.length)   // grow buffer      bytes = new byte[length];    System.arraycopy(other.bytes, 0, bytes, 0, length);  }  public void readFields(DataInput in) throws IOException {    length = in.readUnsignedShort();    if (bytes == null || bytes.length < length)      bytes = new byte[length];    in.readFully(bytes, 0, length);  }  /** Skips over one UTF8 in the input. */  public static void skip(DataInput in) throws IOException {    int length = in.readUnsignedShort();    in.skipBytes(length);  }  public void write(DataOutput out) throws IOException {    out.writeShort(length);    out.write(bytes, 0, length);  }  /** Compare two UTF8s. */  public int compareTo(Object o) {    UTF8 that = (UTF8)o;    return WritableComparator.compareBytes(bytes, 0, length,                                           that.bytes, 0, that.length);  }  /** Convert to a String. */  public String toString() {    StringBuffer buffer = new StringBuffer(length);    try {      synchronized (IBUF) {        IBUF.reset(bytes, length);        readChars(IBUF, buffer, length);      }    } catch (IOException e) {      throw new RuntimeException(e);    }    return buffer.toString();  }  /** Returns true iff <code>o</code> is a UTF8 with the same contents.  */  public boolean equals(Object o) {    if (!(o instanceof UTF8))      return false;    UTF8 that = (UTF8)o;    if (this.length != that.length)      return false;    else      return WritableComparator.compareBytes(bytes, 0, length,                                             that.bytes, 0, that.length) == 0;  }  public int hashCode() {    return WritableComparator.hashBytes(bytes, length);  }  /** A WritableComparator optimized for UTF8 keys. */  public static class Comparator extends WritableComparator {    public Comparator() {      super(UTF8.class);    }    public int compare(byte[] b1, int s1, int l1,                       byte[] b2, int s2, int l2) {      int n1 = readUnsignedShort(b1, s1);      int n2 = readUnsignedShort(b2, s2);      return compareBytes(b1, s1+2, n1, b2, s2+2, n2);    }  }  static {                                        // register this comparator    WritableComparator.define(UTF8.class, new Comparator());  }  /// STATIC UTILITIES FROM HERE DOWN  /// These are probably not used much anymore, and might be removed...  /** Convert a string to a UTF-8 encoded byte array.   * @see String#getBytes(String)   */  public static byte[] getBytes(String string) {    byte[] result = new byte[utf8Length(string)];    try {                                         // avoid sync'd allocations      synchronized (OBUF) {        OBUF.reset();        writeChars(OBUF, string, 0, string.length());        System.arraycopy(OBUF.getData(), 0, result, 0, OBUF.getLength());      }    } catch (IOException e) {      throw new RuntimeException(e);    }    return result;  }  /** Read a UTF-8 encoded string.   *   * @see DataInput#readUTF()   */  public static String readString(DataInput in) throws IOException {    int bytes = in.readUnsignedShort();    StringBuffer buffer = new StringBuffer(bytes);    readChars(in, buffer, bytes);    return buffer.toString();  }  private static void readChars(DataInput in, StringBuffer buffer, int nBytes)    throws IOException {    synchronized (OBUF) {      OBUF.reset();      OBUF.write(in, nBytes);      byte[] bytes = OBUF.getData();      int i = 0;      while (i < nBytes) {        byte b = bytes[i++];        if ((b & 0x80) == 0) {          buffer.append((char)(b & 0x7F));        } else if ((b & 0xE0) != 0xE0) {          buffer.append((char)(((b & 0x1F) << 6)                               | (bytes[i++] & 0x3F)));        } else {          buffer.append((char)(((b & 0x0F) << 12)                               | ((bytes[i++] & 0x3F) << 6)                               |  (bytes[i++] & 0x3F)));        }      }    }  }  /** Write a UTF-8 encoded string.   *   * @see DataOutput#writeUTF(String)   */  public static int writeString(DataOutput out, String s) throws IOException {    if (s.length() > 0xffff/3) {         // maybe too long      LOG.warning("truncating long string: " + s.length()                  + " chars, starting with " + s.substring(0, 20));      s = s.substring(0, 0xffff/3);    }    int len = utf8Length(s);    if (len > 0xffff)                             // double-check length      throw new IOException("string too long!");          out.writeShort(len);    writeChars(out, s, 0, s.length());    return len;  }  /** Returns the number of bytes required to write this. */  private static int utf8Length(String string) {    int stringLength = string.length();    int utf8Length = 0;    for (int i = 0; i < stringLength; i++) {      int c = string.charAt(i);      if ((c >= 0x0001) && (c <= 0x007F)) {        utf8Length++;      } else if (c > 0x07FF) {        utf8Length += 3;      } else {        utf8Length += 2;      }    }    return utf8Length;  }  private static void writeChars(DataOutput out,                                 String s, int start, int length)    throws IOException {    final int end = start + length;    for (int i = start; i < end; i++) {      int code = s.charAt(i);      if (code >= 0x01 && code <= 0x7F) {        out.writeByte((byte)code);      } else if (code <= 0x07FF) {        out.writeByte((byte)(0xC0 | ((code >> 6) & 0x1F)));        out.writeByte((byte)(0x80 |   code       & 0x3F));      } else {        out.writeByte((byte)(0xE0 | ((code >> 12) & 0X0F)));        out.writeByte((byte)(0x80 | ((code >>  6) & 0x3F)));        out.writeByte((byte)(0x80 |  (code        & 0x3F)));      }    }  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女视频一区二区| 欧美v亚洲v综合ⅴ国产v| 欧美久久久影院| 中文字幕一区二区不卡| 日本aⅴ免费视频一区二区三区| 成人小视频免费在线观看| 欧美r级在线观看| 精品一区二区三区免费观看| 色婷婷综合久久久中文字幕| 日韩一区中文字幕| 成人一区二区视频| 国产女同性恋一区二区| 成人看片黄a免费看在线| 2欧美一区二区三区在线观看视频| 日本vs亚洲vs韩国一区三区| 欧美日韩精品免费| 国内精品免费**视频| 欧美电影免费观看完整版| 国内精品免费在线观看| 国产精品嫩草影院av蜜臀| caoporen国产精品视频| 亚洲黄色免费电影| 91精品国产综合久久香蕉麻豆| 美女国产一区二区三区| 久久久综合精品| 一本高清dvd不卡在线观看| 亚洲gay无套男同| 精品乱人伦小说| 在线观看亚洲专区| 精品一区二区在线播放| 自拍偷拍亚洲欧美日韩| 91精品国产综合久久久蜜臀粉嫩| 国内精品视频666| 激情六月婷婷久久| 国产精品蜜臀在线观看| 51久久夜色精品国产麻豆| 粉嫩一区二区三区性色av| 亚洲成a人片在线观看中文| 国产目拍亚洲精品99久久精品| 91蝌蚪porny| 成人精品国产一区二区4080| 婷婷开心激情综合| 亚洲一区二区三区中文字幕| 国产亚洲视频系列| 欧美电视剧在线观看完整版| 欧美吻胸吃奶大尺度电影 | 日韩视频在线你懂得| 99精品欧美一区| 国产成人综合在线观看| 麻豆精品视频在线观看| 五月天精品一区二区三区| 一区二区视频在线看| 中文字幕中文字幕在线一区 | 日韩视频中午一区| 日韩你懂的在线播放| 欧美另类高清zo欧美| 欧美一级欧美一级在线播放| 在线精品视频免费观看| 99re6这里只有精品视频在线观看| 国产精品一区二区三区四区| 美日韩一级片在线观看| 久久97超碰色| 国产最新精品免费| 成人网男人的天堂| 在线观看国产一区二区| 欧美日韩国产a| 欧美日韩一区二区在线观看| 欧美日韩激情一区二区| 日韩一区二区三区视频| 久久久久久久久岛国免费| 国产欧美一区二区精品婷婷| 国产精品欧美久久久久一区二区| 国产精品视频一区二区三区不卡| 中文字幕一区二区在线观看| 亚洲成人你懂的| 国内精品伊人久久久久av一坑| 成年人国产精品| 在线综合+亚洲+欧美中文字幕| 久久精品水蜜桃av综合天堂| 国产精品久久久久精k8| 日韩精品电影在线观看| 成人黄色大片在线观看| 欧美美女一区二区在线观看| 久久久国际精品| 三级影片在线观看欧美日韩一区二区| 国产在线播放一区二区三区| 色婷婷激情一区二区三区| 欧美精品一区二区三区视频| 国产精品久久毛片av大全日韩| 日韩高清电影一区| 成人动漫视频在线| 久久久精品免费网站| 日本不卡一二三区黄网| 色呦呦一区二区三区| 国产视频一区二区三区在线观看| 亚洲精品午夜久久久| 不卡一区二区在线| 日本一区二区免费在线观看视频| 日本美女视频一区二区| 在线观看视频91| 日韩美女视频一区| eeuss鲁片一区二区三区 | 日韩视频一区二区| 午夜伦欧美伦电影理论片| 色88888久久久久久影院野外 | 欧美一区二区在线视频| 午夜精品免费在线| 欧美亚洲国产一区在线观看网站| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 久久机这里只有精品| 日韩欧美成人午夜| 国产酒店精品激情| 精品国产麻豆免费人成网站| 久久99国产精品麻豆| 久久精品欧美日韩| 色综合中文字幕国产| 最新中文字幕一区二区三区 | 国产精品久久毛片| 色综合久久综合网| 激情成人综合网| 国产午夜精品福利| 91精品1区2区| 美女视频黄久久| 国产女同性恋一区二区| 色欧美片视频在线观看| 青青草97国产精品免费观看| 国产亚洲自拍一区| 91精品国产欧美一区二区18 | 欧美色视频在线| 国产精品久久久久久久浪潮网站| 色乱码一区二区三区88| 成人午夜电影网站| 国产精品午夜久久| 久久99精品久久久久| 欧美午夜免费电影| 免费在线观看精品| 欧美精三区欧美精三区| 国产不卡一区视频| 精品综合免费视频观看| 最新日韩av在线| 中日韩免费视频中文字幕| 欧美久久一区二区| 91国在线观看| 色8久久人人97超碰香蕉987| 国产精品自拍毛片| 国内精品视频一区二区三区八戒| 亚洲成人三级小说| 午夜激情综合网| 亚洲国产精品久久不卡毛片| 亚洲理论在线观看| 亚洲人成伊人成综合网小说| 国产精品免费久久| 国产精品久久久久久久久免费丝袜| 777xxx欧美| 日韩久久久久久| 精品美女一区二区| 国产欧美日韩综合精品一区二区| 久久亚区不卡日本| 精品国产乱码久久| 国产人成一区二区三区影院| 精品久久久影院| 国产精品美女久久久久久久久久久| 国产日产欧美一区二区三区| 国产偷国产偷精品高清尤物| 国产精品人成在线观看免费| 国产精品美女www爽爽爽| 一区二区三区欧美视频| 午夜精品一区二区三区电影天堂| 日本vs亚洲vs韩国一区三区二区| 久久99精品久久久久久| 99热99精品| 欧美成人在线直播| 国产精品久久一卡二卡| 午夜一区二区三区在线观看| 久88久久88久久久| 91免费国产在线观看| 精品久久久久久久久久久久包黑料 | 亚洲午夜久久久久久久久久久| 丝袜美腿成人在线| 国产精品影视网| 51精品秘密在线观看| 国产精品色一区二区三区| 日本中文字幕一区二区有限公司| 国产精品影视在线观看| 欧美精品国产精品| 亚洲日本青草视频在线怡红院| 日本亚洲视频在线| 欧美影院一区二区| 国产精品久久久久永久免费观看 | 亚洲一区二区三区四区的| 日本午夜一本久久久综合| 日本精品视频一区二区| 国产精品嫩草99a| 极品少妇xxxx精品少妇| 91精品国产综合久久久蜜臀图片| 亚洲人精品一区| 91福利国产精品| 亚洲激情图片小说视频| 一本久久综合亚洲鲁鲁五月天 | 国产 欧美在线|