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

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

?? messagetutorial.java

?? jxta信息封裝的一個(gè)很好的例子
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
/* * 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 tutorial.message;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 MessageTutorial {    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, 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, data.length);            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(), 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.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
九九九久久久精品| 日韩国产精品久久久| 国产精品99久久久久久宅男| 欧美精品一区二区久久久| 九九视频精品免费| 久久久久久久久99精品| 国产成人精品影视| 国产精品久久久久久久久久久免费看 | 精品国产免费人成电影在线观看四季| 美女视频黄 久久| 久久久综合精品| 99在线精品观看| 亚洲亚洲精品在线观看| 4438成人网| 国产精品18久久久久久vr| 国产精品久久精品日日| 91久久线看在观草草青青| 丝袜亚洲精品中文字幕一区| 日韩午夜激情电影| 国产福利精品导航| 一区二区三区中文字幕在线观看| 精品污污网站免费看| 免费观看91视频大全| 欧美激情在线一区二区| 色屁屁一区二区| 日本vs亚洲vs韩国一区三区 | 欧美一区午夜视频在线观看| 狠狠色丁香婷婷综合久久片| 亚洲欧洲精品一区二区三区不卡| 欧美日韩mp4| 从欧美一区二区三区| 亚洲午夜久久久久中文字幕久| 日韩一级免费观看| 成人精品视频.| 日韩av在线发布| 中文字幕一区二区视频| 日韩一级黄色片| 91麻豆免费在线观看| 老司机精品视频在线| 亚洲美女区一区| 精品国产欧美一区二区| 在线观看日韩一区| 国产高清精品在线| 偷拍日韩校园综合在线| 国产精品毛片无遮挡高清| 欧美嫩在线观看| 91在线国产观看| 国模一区二区三区白浆| 亚洲高清视频中文字幕| 国产精品免费久久久久| 日韩欧美国产小视频| 欧美手机在线视频| 成人免费毛片aaaaa**| 日韩高清电影一区| 亚洲一区欧美一区| 国产精品久线在线观看| 久久人人97超碰com| 欧美人牲a欧美精品| 99国产精品久| 成人黄色国产精品网站大全在线免费观看| 日韩av中文字幕一区二区三区| 亚洲欧美日韩在线| 中文字幕的久久| 久久男人中文字幕资源站| 日韩一级高清毛片| 欧美日韩国产精品自在自线| 91网站黄www| 成人午夜视频在线观看| 国产成人夜色高潮福利影视| 狠狠色狠狠色综合| 麻豆久久久久久| 热久久久久久久| 天天综合网 天天综合色| 亚洲综合丁香婷婷六月香| 亚洲老妇xxxxxx| 亚洲精品亚洲人成人网在线播放| 国产精品欧美极品| 国产喷白浆一区二区三区| ww亚洲ww在线观看国产| 2023国产精品自拍| 亚洲精品一线二线三线| 精品成人免费观看| 精品久久久久香蕉网| 欧美精品一区二区三区蜜桃| 精品免费日韩av| 久久一日本道色综合| 久久久一区二区| 国产精品日产欧美久久久久| 国产精品久久久久久久久久久免费看 | 中文字幕不卡的av| 亚洲婷婷在线视频| 樱花草国产18久久久久| 亚洲国产精品久久久久婷婷884| 亚洲综合在线免费观看| 亚洲成a人片在线观看中文| 亚洲6080在线| 精品在线免费观看| 国产精品综合久久| 成人高清视频在线| 欧美综合在线视频| 欧美一卡二卡在线| 久久久精品国产免费观看同学| 久久精品欧美一区二区三区麻豆| 国产精品免费aⅴ片在线观看| 国产精品国产三级国产| 亚洲综合清纯丝袜自拍| 麻豆国产一区二区| 国产成人精品亚洲日本在线桃色 | 国产成人一区在线| 日本电影欧美片| 欧美一区二区在线看| 久久久精品国产免大香伊| 亚洲素人一区二区| 蜜桃传媒麻豆第一区在线观看| 国产一区二区91| 一本色道久久加勒比精品| 日韩一区二区高清| 中文字幕在线不卡视频| 日韩专区中文字幕一区二区| 国产激情一区二区三区桃花岛亚洲| 99天天综合性| 3d成人h动漫网站入口| 中文字幕av资源一区| 午夜久久福利影院| av成人动漫在线观看| 日韩欧美一区二区免费| 亚洲品质自拍视频| 国内精品国产成人| 欧美日韩国产系列| 一区免费观看视频| 韩国精品一区二区| 欧美日韩一区二区三区高清| 久久亚区不卡日本| 午夜精品在线视频一区| eeuss影院一区二区三区| 欧美成人一区二区三区片免费 | 看国产成人h片视频| 91小视频在线| 久久奇米777| 免费在线观看不卡| 欧洲av一区二区嗯嗯嗯啊| 中文字幕精品在线不卡| 老司机一区二区| 欧美丝袜丝交足nylons图片| 国产精品毛片无遮挡高清| 国产又黄又大久久| 欧美一区二区视频观看视频| 亚洲视频狠狠干| 成人久久久精品乱码一区二区三区| 欧美一区二区大片| 亚洲国产欧美另类丝袜| 成人v精品蜜桃久久一区| 久久久久综合网| 蜜桃av一区二区三区| 777亚洲妇女| 亚洲 欧美综合在线网络| 日本高清视频一区二区| 亚洲欧美一区二区三区国产精品| 成人综合婷婷国产精品久久免费| 日韩欧美久久久| 美女网站色91| 欧美一区二区在线不卡| 爽爽淫人综合网网站| 欧美日韩视频在线观看一区二区三区 | 国产区在线观看成人精品 | 国产成人综合自拍| 精品欧美一区二区三区精品久久 | 91精品免费观看| 天天综合网 天天综合色| 欧美日韩免费观看一区二区三区 | 精品一区二区免费在线观看| 日韩欧美久久久| 久久99精品一区二区三区三区| 337p亚洲精品色噜噜| 日韩专区中文字幕一区二区| 777午夜精品视频在线播放| 日韩专区欧美专区| 日韩欧美一区二区不卡| 精品一区二区三区的国产在线播放| 精品国产免费久久| 国产盗摄女厕一区二区三区| 国产精品久久久久永久免费观看 | 精品欧美乱码久久久久久1区2区| 蜜桃免费网站一区二区三区| 精品免费日韩av| 岛国一区二区三区| 亚洲精品乱码久久久久| 欧美性猛交xxxx黑人交| 日本欧美一区二区三区乱码| 精品国产乱码久久久久久图片| 国产成人免费视频精品含羞草妖精 | 国产欧美日本一区二区三区| 成人av免费观看| 亚洲成人一区二区| 精品久久人人做人人爽| 成人av资源在线| 亚洲国产中文字幕在线视频综合| 日韩三区在线观看| 国产成人在线免费| 亚洲午夜一区二区|