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

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

?? idbytes.java

?? jxme的一些相關程序,主要是手機上程序開發以及手機和計算機通信的一些程序資料,程序編譯需要Ant支持
?? JAVA
字號:
/************************************************************************
 *
 * $Id: IDBytes.java,v 1.2 2002/03/04 21:42:58 echtcherbina Exp $
 *
 * Copyright (c) 2001 Sun Microsystems, Inc.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by the
 *       Sun Microsystems, Inc. for Project JXTA."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA"
 *    must not be used to endorse or promote products derived from this
 *    software without prior written permission. For written
 *    permission, please contact Project JXTA at http://www.jxta.org.
 *
 * 5. Products derived from this software may not be called "JXTA",
 *    nor may "JXTA" appear in their name, without prior written
 *    permission of Sun.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL SUN MICROSYSTEMS OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of Project JXTA.  For more
 * information on Project JXTA, please see
 * <http://www.jxta.org/>.
 *
 * This license is based on the BSD license adopted by the Apache Foundation.
 *********************************************************************************/

package net.jxta.impl.id.UUID;

import java.lang.reflect.Constructor;
import java.lang.String;
import java.net.URL;
//PDA requirements 19.02.2002
//class java.util.Arrays was not presented in jdk 1.1.8, it was excluded
//import java.util.Arrays;
//PDA requirements 19.02.2002
import java.util.zip.Checksum;                           // used in hashCode
import java.util.zip.CRC32;

import java.io.IOException;
import java.lang.IllegalArgumentException;
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.UnknownServiceException;
import java.security.NoSuchAlgorithmException;

import net.jxta.impl.id.UUID.UUID;
import net.jxta.impl.id.UUID.UUIDFactory;

/**
 * This class represents a JXTA ID. IDs are used to uniquely identify a
 * peer, a peer group and a pipe or any other objects manipulated by the
 * core. JXTA ID are represented as UUID.
 *
 * @see net.jxta.id.IDFactory
 * @see         net.jxta.impl.id.UUID.UUID
 * @see         net.jxta.impl.id.UUID.UUIDFactory
 *
 * @see         net.jxta.peergroup.PeerGroupID
 *
 * @version     $Revision: 1.2 $
 * @since JXTA 1.0
 */
public class IDBytes implements Cloneable, java.io.Serializable {

    protected byte [] bytes = null;

    public static final Instantiator INSTANTIATOR = new Instantiator();

    /**
     *  Constructor for the null case. This constructor initializes only the
     *  flag fields of the ID. This is not usually a useful
     *  operation since there are already constants. Provided for subclasses to
     *  make their own null constants.
     *
     * @since JXTA 1.0
     */

    IDBytes() {
        this.bytes = new byte[ IDFormat.IdByteArraySize ];
        this.bytes[IDFormat.flagsOffset + IDFormat.flagsIdTypeOffset] = 0;
    };


    /**
     * clone this object.
     *
     * Most of the time this object is held private and immutable, so there
     * is no need to clone it, but should the need arise (the object is used
     * in a mutable manner and shared), then this expensive clone method does
     * the correct thing.
     */
    protected Object clone() {
        IDBytes myClone = new IDBytes();
        myClone.bytes = (byte[]) bytes.clone();
        return myClone;
    }

    /**
     * Compares two IDs for equality.
     *
     *  @since JXTA 1.0
     *
     * @param target  the ID to be compared against.
     * @return	boolean true if IDs are equal, false otherwise.
     **/
    public boolean equals( Object target ) {
        if (this == target)
            return true;

        if (target instanceof IDBytes) {
            //PDA requirements 19.02.2002
            //class java.util.Arrays was not presented in jdk 1.1.8, it was excluded
            //return Arrays.equals( bytes, ((IDBytes)target).bytes );
            byte[] bytes2 = ((IDBytes)target).bytes;
            if (bytes == bytes2)
                return true;
            if (bytes == null || bytes2 == null)
                return false;
            int length = bytes.length;
            if (bytes2.length != length)
                return false;
            for (int i=0; i<length; i++)
                if (bytes[i] != bytes2[i])
                    return false;
            return true;
            //PDA requirements 19.02.2002
        }
        else
            return false;
    }

    /**
     * Public member calculates a hash code for this ID. Used by Hashmaps.
     *
     *  @since JXTA 1.0
     *
     * @return int Containing the hashcode of this ID.
     **/
    public int hashCode() {
        Checksum crc = new CRC32();

        crc.update( bytes, 0, bytes.length );
        return (int) crc.getValue();
    };

    /**
     * Public member which returns a string representation of the ID.
     * This implementations encodes the ID into a URI.
     *
     *  @since JXTA 1.0
     *
     * @return	String containting the URI
     **/
    public String toString( ) {
        return getUniqueValue().toString();
    };

    /**
     *
     *  Private replacement for toHexString since we need the leading 0 digits.
     *  Returns a String containing byte value encoded as 2 hex characters.
     *
     *  @param  theByte a byte containing the value to be encoded.
     *  @return	String containing byte value encoded as 2 hex characters.
     */
    private static String toHexDigits( byte theByte ) {
        final char [] HEXDIGITS = { '0', '1', '2', '3', '4', '5', '6', '7',
        '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
        StringBuffer result = new StringBuffer(2);

        result.append( HEXDIGITS[(theByte >>> 4) & 15] );
        result.append( HEXDIGITS[theByte & 15] );

        return result.toString();
    }

    /**
     *
     *  Return an object containing the unique value of the ID. This object must
     *  provide implementations of toString() and hashCode() that are canonical
     *  and conisistent from run-to-run given the same input values. Beyond
     *  this nothing should be assumed about the nature of this object. For some
     *  implementations the object returned may be the same as provided.
     *
     *  @return	Object which can provide canonical representations of the ID.
     *
     *  @since JXTA 1.0
     */
    Object getUniqueValue() {
        StringBuffer    encoded = new StringBuffer();
        int             lastIndex;

        // find the last non-zero index.
        for( lastIndex = IDFormat.flagsOffset - 1; lastIndex > 0; lastIndex-- )
            if( 0 != bytes[lastIndex] )
                break;

        // build the string.
        for( int eachByte = 0; eachByte <= lastIndex; eachByte++ ) {
            encoded.append( toHexDigits(bytes[eachByte]).toUpperCase() );
        }

        // append the last two chars.
        encoded.append( toHexDigits(bytes[IDFormat.flagsOffset + IDFormat.flagsIdTypeOffset]).toUpperCase() );

        return encoded.toString();
    }

    /**
     * convert a long into the byte array
     *
     * @param offset offset
     * @paran value  value
     *
     *  @since JXTA 1.0
     */
    void longIntoBytes( int offset, long value ) {
        for( int eachByte = 0; eachByte < 8; eachByte ++ )
            bytes[eachByte + offset] = (byte) (value >> ((7 - eachByte) * 8L));

    }

    /**
     * return the long value
     *
     * @param offset
     * @return	long
     *
     *  @since JXTA 1.0
     */

    long bytesIntoLong( int offset ) {
        long result = 0L;

        for( int eachByte = 0; eachByte < 8; eachByte ++ )
            result |= ((long)(bytes[eachByte + offset] & 0xff)) << ((7 - eachByte) * 8L);

        return result;
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品综合久久久久久| 国产精品亚洲一区二区三区在线 | 欧美在线不卡视频| 成人免费视频一区二区| 国产91精品欧美| 高清国产一区二区| 国产91精品久久久久久久网曝门 | 91在线免费播放| 91影视在线播放| 91蜜桃在线观看| 在线一区二区三区四区五区| 91精品1区2区| 在线播放中文字幕一区| 欧美一区二区视频免费观看| 日韩视频一区在线观看| 精品99久久久久久| 日本一区二区三级电影在线观看| 中国色在线观看另类| 亚洲人成在线播放网站岛国| 亚洲国产aⅴ天堂久久| 秋霞电影网一区二区| 麻豆精品在线播放| 丁香天五香天堂综合| 欧洲av在线精品| 欧美一区欧美二区| 久久久国产午夜精品| 亚洲品质自拍视频| 蜜乳av一区二区三区| 国产成人精品午夜视频免费| 色琪琪一区二区三区亚洲区| 欧美一区二区三区四区在线观看 | 亚洲一区二区影院| 蜜臀精品久久久久久蜜臀| 国产成人av电影在线观看| kk眼镜猥琐国模调教系列一区二区| 91色porny蝌蚪| 日韩欧美国产三级电影视频| 国产精品入口麻豆九色| 三级不卡在线观看| 成熟亚洲日本毛茸茸凸凹| 欧美日韩免费一区二区三区| 精品免费国产一区二区三区四区| 亚洲卡通动漫在线| 久久se这里有精品| 在线看国产日韩| 久久久91精品国产一区二区三区| 亚洲成人av资源| 粉嫩欧美一区二区三区高清影视| 69成人精品免费视频| 亚洲婷婷在线视频| 国产成人精品三级| 欧美一区二区三区视频在线| 亚洲色图在线播放| 国产99久久久国产精品免费看| 91精品国产福利| 亚洲在线一区二区三区| 99视频国产精品| 久久蜜臀中文字幕| 麻豆成人在线观看| 337p亚洲精品色噜噜噜| 亚洲妇熟xx妇色黄| 99国产精品久久久久久久久久| 久久久久久久综合日本| 久久99这里只有精品| 欧美一区二区不卡视频| 同产精品九九九| 欧美日韩视频在线一区二区| 一区二区三区欧美久久| 97久久精品人人做人人爽| 欧美激情一区二区三区| 高清在线成人网| 国产欧美日韩精品a在线观看| 久久超碰97中文字幕| 精品黑人一区二区三区久久| 精一区二区三区| 精品日韩一区二区三区免费视频| 毛片基地黄久久久久久天堂| 欧美美女一区二区在线观看| 日韩精品每日更新| 欧美一卡2卡三卡4卡5免费| 日韩国产精品久久| 欧美一级二级在线观看| 蜜桃久久久久久| 日韩欧美在线不卡| 狠狠色狠狠色合久久伊人| 久久久噜噜噜久噜久久综合| 成人中文字幕电影| 亚洲日本电影在线| 欧美日韩精品欧美日韩精品| 日韩在线一区二区| 精品国产亚洲在线| av一区二区三区四区| 一区二区三区蜜桃| 678五月天丁香亚洲综合网| 美腿丝袜在线亚洲一区 | 成人精品免费视频| 亚洲乱码国产乱码精品精的特点 | 成人深夜在线观看| 久久久三级国产网站| 国产午夜亚洲精品午夜鲁丝片| 麻豆精品一二三| 欧美激情在线看| 91成人免费网站| 亚洲成av人**亚洲成av**| 日韩欧美激情在线| 成人黄色小视频| 亚洲亚洲精品在线观看| 欧美电影免费观看高清完整版| 国产一区日韩二区欧美三区| 亚洲免费在线电影| 日韩一区二区三免费高清| 丰满白嫩尤物一区二区| 亚洲综合久久久久| 日韩欧美一级在线播放| 成人av资源下载| 日韩精品91亚洲二区在线观看 | 日韩福利视频导航| 国产亚洲人成网站| 欧美日韩黄色一区二区| 国产成人日日夜夜| 日韩黄色在线观看| 亚洲精品综合在线| 久久综合资源网| 欧美中文字幕亚洲一区二区va在线| 黑人精品欧美一区二区蜜桃| 亚洲免费成人av| 亚洲毛片av在线| 精品国产亚洲在线| 欧美精品欧美精品系列| www.性欧美| 国产精品一级在线| 美女视频黄久久| 亚洲一区二区免费视频| 国产精品久久久久一区二区三区共| 91.com视频| 欧美性三三影院| 91香蕉视频污| 国产91精品一区二区麻豆网站| 看电视剧不卡顿的网站| 亚洲r级在线视频| 国产精品久久久久久户外露出| 久久亚洲一区二区三区明星换脸| 欧美久久久久久久久中文字幕| 色综合视频一区二区三区高清| 国产成人精品免费一区二区| 国产一本一道久久香蕉| 美腿丝袜亚洲色图| 午夜日韩在线电影| 亚洲午夜免费视频| 一级日本不卡的影视| 国产精品成人一区二区三区夜夜夜| 国产人久久人人人人爽| 久久先锋资源网| 久久先锋影音av鲁色资源网| 2020国产精品| 亚洲国产精品ⅴa在线观看| 国产欧美精品区一区二区三区 | 国产精品久久久久久久久免费桃花 | 国产成人日日夜夜| 国产精品1区2区| 国产成人在线看| 99久久er热在这里只有精品15| 成人av在线电影| 91色婷婷久久久久合中文| 色婷婷亚洲综合| 欧美日韩国产综合视频在线观看| 欧美高清性hdvideosex| 欧美一区二区三区在线| 精品欧美一区二区在线观看| 337p粉嫩大胆噜噜噜噜噜91av| 国产亚洲精品福利| 亚洲欧美在线高清| 亚洲成人精品在线观看| 粉嫩av一区二区三区在线播放| 成人av高清在线| 精品视频1区2区| www国产精品av| 亚洲美女屁股眼交3| 日韩精品一级二级| 国产大片一区二区| 色婷婷综合久久久中文字幕| 欧美一区二视频| 国产女人水真多18毛片18精品视频| 亚洲欧洲日韩av| 午夜精品123| 国产成人免费在线观看不卡| 在线观看91视频| 久久综合视频网| 一区二区三区免费观看| 国产在线视频一区二区三区| 一本色道a无线码一区v| 欧美va亚洲va香蕉在线| 亚洲色图一区二区三区| 久久精品国产亚洲5555| 99久久久久久99| 日韩欧美在线网站| 一区二区视频在线| 国产一区亚洲一区| 欧美唯美清纯偷拍| 国产片一区二区|