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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? messageutil.java

?? CoolFace是基于jxta的P2P系統(tǒng)
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright (c) 2006-2007 Sun Microsystems, Inc.  All rights reserved. *   *  The Sun Project JXTA(TM) Software License *   *  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 Sun Microsystems, Inc. for JXTA(TM) technology."  *     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. *   *  JXTA is a registered trademark of Sun Microsystems, Inc. in the United  *  States and other countries. *   *  Please see the license information page at : *  <http://www.jxta.org/project/www/license.html> for instructions on use of  *  the license in source files. *   *  ==================================================================== *   *  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 com.cn.darkblue.util;import net.jxta.document.AdvertisementFactory;import net.jxta.document.MimeMediaType;import net.jxta.document.StructuredDocumentFactory;import net.jxta.document.XMLDocument;import net.jxta.endpoint.ByteArrayMessageElement;import net.jxta.endpoint.Message;import net.jxta.endpoint.Message.ElementIterator;import net.jxta.endpoint.MessageElement;import net.jxta.endpoint.StringMessageElement;import net.jxta.endpoint.TextDocumentMessageElement;import net.jxta.endpoint.WireFormatMessage;import net.jxta.endpoint.WireFormatMessageFactory;import net.jxta.id.IDFactory;import net.jxta.peergroup.PeerGroupID;import net.jxta.pipe.PipeService;import net.jxta.protocol.PipeAdvertisement;import java.io.ByteArrayOutputStream;import java.io.File;import java.io.IOException;import java.io.InputStream;import java.io.ObjectInputStream;import java.io.ObjectOutputStream;import java.io.RandomAccessFile;import java.util.zip.GZIPInputStream;import java.util.zip.GZIPOutputStream;/** * A simple and re-usable example of manipulating JXATA Messages. Included in * this tutorial are: * <p/> * <ul> * <li>Adding and reading {@code String}, {@code int} and {@code long} with Message elements.</li> * <li>Adding and reading Java {@code Object} with Message Elements. * <li>Adding and reading byte arrays with Message Elements.</li> * <li>Adding and reading JXTA Advertisements with Message Elements.</li> * <li>Compressing message element content with gzip.</li> * </ul> */public class MessageUtil {    private final static MimeMediaType GZIP_MEDIA_TYPE = new MimeMediaType("application/gzip").intern();    /**     * Adds a String to a Message as a StringMessageElement     *     * @param message   The message to add to     * @param nameSpace The namespace of the element to add. a null value assumes default namespace.     * @param elemName  Name of the Element.     * @param string    The string to add     */    public static void addStringToMessage(Message message, String nameSpace, String elemName, String string) {        message.addMessageElement(nameSpace, new StringMessageElement(elemName, string, null));    }    /**     * Adds a long to a message     *     * @param message   The message to add to     * @param nameSpace The namespace of the element to add. a null value assumes default namespace.     * @param elemName  Name of the Element.     * @param data      The feature to be added to the LongToMessage attribute     */    public static void addLongToMessage(Message message, String nameSpace, String elemName, long data) {        message.addMessageElement(nameSpace, new StringMessageElement(elemName, Long.toString(data), null));    }    /**     * Adds a int to a message     *     * @param message   The message to add to     * @param nameSpace The namespace of the element to add. a null value assumes default namespace.     * @param elemName  Name of the Element.     * @param data      The feature to be added to the IntegerToMessage attribute     */    public static void addIntegerToMessage(Message message, String nameSpace, String elemName, int data) {        message.addMessageElement(nameSpace, new StringMessageElement(elemName, Integer.toString(data), null));    }    /**     * Adds an byte array to a message     *     * @param message   The message to add to     * @param nameSpace The namespace of the element to add. a null value assumes default namespace.     * @param elemName  Name of the Element.     * @param data      the byte array     * @param compress  indicates whether to use GZIP compression     * @throws IOException if an io error occurs     */    public static void addByteArrayToMessage(Message message, String nameSpace, String elemName, byte[] data, int size,boolean compress) throws IOException {        byte[] buffer = data;        MimeMediaType mimeType = MimeMediaType.AOS;        if (compress) {            ByteArrayOutputStream outStream = new ByteArrayOutputStream();            GZIPOutputStream gos = new GZIPOutputStream(outStream);            gos.write(data, 0, size);            gos.finish();            gos.close();            buffer = outStream.toByteArray();            mimeType = GZIP_MEDIA_TYPE;        }        message.addMessageElement(nameSpace, new ByteArrayMessageElement(elemName, mimeType, buffer, null));    }    /**     * Adds an Object to message within the specified name space and with the specified element name     * @param message   the message to add the object to     * @param nameSpace the name space to add the object under     * @param elemName  the given element name     * @param object    the object     * @throws IOException if an io error occurs     */    public static void addObjectToMessage(Message message, String nameSpace, String elemName, Object object) throws IOException {        ByteArrayOutputStream bos = new ByteArrayOutputStream();        ObjectOutputStream oos = new ObjectOutputStream(bos);        oos.writeObject(object);        oos.close();        bos.close();        addByteArrayToMessage(message, nameSpace, elemName, bos.toByteArray(),bos.size(), false);    }    /**     * Returns a String from a message     *     * @param message   The message to retrieve from     * @param nameSpace The namespace of the element to get.     * @param elemName  Name of the Element.     * @return The string value or {@code null} if there was no element matching the specified name.     */    public static String getStringFromMessage(Message message, String nameSpace, String elemName) {        MessageElement me = message.getMessageElement(nameSpace, elemName);        if (null != me) {            return me.toString();        } else {            return null;        }    }    /**     * Returns an long from a message     *     * @param message   The message to retrieve from     * @param nameSpace The namespace of the element to get.     * @param elemName  Name of the Element.     * @return The long value     * @throws NumberFormatException If the String does not contain a parsable int.     */    public static long getLongFromMessage(Message message, String nameSpace, String elemName) throws NumberFormatException {        String longStr = getStringFromMessage(message, nameSpace, elemName);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲日本在线观看| 91精品午夜视频| 亚洲视频香蕉人妖| 91丨九色丨尤物| 一区二区三区免费| 欧美日韩久久一区| 韩国午夜理伦三级不卡影院| 久久亚洲二区三区| 高清shemale亚洲人妖| 国产精品女上位| 欧美性一二三区| 奇米在线7777在线精品| 久久先锋影音av鲁色资源网| 懂色av一区二区三区蜜臀| 综合分类小说区另类春色亚洲小说欧美 | 日韩成人av影视| 日韩欧美久久一区| 成人综合婷婷国产精品久久免费| 成人欧美一区二区三区1314| 欧美三级欧美一级| 国产一区二区三区四区五区美女| 亚洲国产精品精华液ab| 欧美撒尿777hd撒尿| 久久不见久久见免费视频1| 中文一区二区在线观看| 欧美图片一区二区三区| 久久精品国产一区二区三区免费看| 久久蜜桃一区二区| 欧美三级电影一区| 顶级嫩模精品视频在线看| 亚洲高清免费一级二级三级| 精品福利一二区| 91久久一区二区| 狠狠久久亚洲欧美| 一片黄亚洲嫩模| 久久久久久久久久看片| 欧美日韩久久久| 北条麻妃一区二区三区| 久久国内精品视频| 亚洲一区二区三区视频在线 | 国产一区二区在线电影| 亚洲最大色网站| 国产日产欧产精品推荐色| 欧美午夜精品久久久| 国产精品1024久久| 日韩精品三区四区| 亚洲人成伊人成综合网小说| 精品国产伦一区二区三区观看方式| 99re热这里只有精品免费视频| 麻豆91精品视频| 亚洲国产aⅴ天堂久久| 国产精品欧美经典| 久久精品亚洲国产奇米99| 欧美人伦禁忌dvd放荡欲情| www.成人网.com| 国产精品一二三区在线| 麻豆精品在线视频| 日本aⅴ精品一区二区三区| 一区二区高清免费观看影视大全| 国产视频在线观看一区二区三区| 91精品国产综合久久久久久| 欧美性一级生活| 色哟哟国产精品免费观看| k8久久久一区二区三区| 国产精品综合一区二区三区| 久久精品99国产精品| 日韩二区三区四区| 日韩精品午夜视频| 青青国产91久久久久久| 天天免费综合色| 亚洲地区一二三色| 亚洲色大成网站www久久九九| 国产精品色哟哟网站| 国产区在线观看成人精品| 国产亚洲精品bt天堂精选| 久久美女艺术照精彩视频福利播放| 欧美喷潮久久久xxxxx| 欧美视频在线不卡| 欧美老女人第四色| 日韩欧美一二三区| 精品女同一区二区| 久久精品男人天堂av| 亚洲国产精品精华液2区45| 国产精品久久久久aaaa| 18欧美乱大交hd1984| 亚洲精品国久久99热| 一区二区三区精品久久久| 亚洲第一综合色| 蜜桃91丨九色丨蝌蚪91桃色| 国产综合久久久久影院| 国产99久久精品| 日本久久一区二区| 欧美精品日韩一本| 精品区一区二区| 国产精品理伦片| 亚洲国产日韩a在线播放| 午夜精品福利在线| 国内欧美视频一区二区| 不卡高清视频专区| 欧美日韩免费视频| 精品粉嫩超白一线天av| 中文字幕在线观看一区二区| 丁香激情综合国产| 色欧美日韩亚洲| 亚洲福利电影网| 在线观看欧美日本| 欧美精品日韩一本| 久久综合久久99| 亚洲欧美偷拍三级| 日韩高清一区二区| 高清成人免费视频| 欧美日韩激情一区| 国产区在线观看成人精品| 亚洲综合免费观看高清在线观看| 日韩电影在线看| 波多野结衣视频一区| 91精品国产综合久久精品| 国产日产精品一区| 日韩二区三区四区| av电影天堂一区二区在线观看| 欧美精品亚洲二区| 日韩一区日韩二区| 麻豆精品在线视频| 色8久久精品久久久久久蜜| 久久综合久色欧美综合狠狠| 亚洲欧美另类久久久精品2019| 日本aⅴ免费视频一区二区三区| 成人精品一区二区三区中文字幕| 这里只有精品免费| ●精品国产综合乱码久久久久| 美女脱光内衣内裤视频久久网站| 91色视频在线| 久久久久综合网| 日本午夜精品一区二区三区电影| a在线欧美一区| 欧美xxxxx牲另类人与| 亚洲大片在线观看| 91免费视频网址| 国产欧美日产一区| 激情伊人五月天久久综合| 欧美亚洲国产一区在线观看网站 | 日韩精品在线一区| 一二三区精品福利视频| 国产suv精品一区二区6| 日韩免费视频一区| 污片在线观看一区二区| 91久久国产最好的精华液| 久久精品欧美日韩精品| 国内精品嫩模私拍在线| 欧美一区二区三级| 亚洲va国产va欧美va观看| a亚洲天堂av| 国产精品成人一区二区艾草 | 99久久久国产精品| 久久久久久电影| 韩国精品免费视频| 精品久久久久av影院| 奇米影视一区二区三区| 制服丝袜国产精品| 日韩av一二三| 69久久99精品久久久久婷婷| 亚洲国产精品欧美一二99| 色av一区二区| 亚洲国产中文字幕| 日本高清不卡视频| 亚洲一区影音先锋| 欧美日韩免费高清一区色橹橹| 一区二区三区日本| 欧美视频一区二区在线观看| 亚洲午夜久久久| 欧美日韩国产高清一区二区三区 | 欧美日韩精品一区二区在线播放 | 欧美一区二视频| 男男视频亚洲欧美| 日韩一区二区精品葵司在线| 奇米色一区二区| 精品黑人一区二区三区久久| 国产毛片精品视频| 亚洲国产精品v| 91麻豆国产在线观看| 亚洲精品高清在线| 欧美福利视频一区| 精品在线一区二区| 欧美激情一区二区三区不卡| 成人avav在线| 亚洲不卡一区二区三区| 在线播放国产精品二区一二区四区| 天天综合色天天| 久久久影视传媒| 99re免费视频精品全部| 午夜精品久久久| 久久美女高清视频| 91国产成人在线| 久久99热99| 国产精品毛片a∨一区二区三区| 91丨porny丨国产入口| 日本最新不卡在线| 中文字幕欧美区| 欧美三级韩国三级日本一级| 激情文学综合网|