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

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

?? textdocumentmessageelement.java

?? jxta平臺的開發包
?? JAVA
字號:
/************************************************************************ * * $Id: TextDocumentMessageElement.java,v 1.5 2005/08/08 19:59:06 bondolo 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.endpoint;import java.io.ByteArrayInputStream;import java.io.InputStream;import java.io.OutputStream;import java.io.Reader;import java.io.Writer;import java.lang.ref.SoftReference;import java.io.UnsupportedEncodingException;import java.io.IOException;import org.apache.log4j.Level;import org.apache.log4j.Logger;import net.jxta.document.MimeMediaType;import net.jxta.document.TextDocument;/** *  A Message Element using JXTA TextDocument for the element data. * **/public class TextDocumentMessageElement extends TextMessageElement {        /**     *  Log4J Logger     **/    private static final Logger LOG = Logger.getLogger( TextDocumentMessageElement.class.getName() );        /**     *  The data for this element.     **/    protected TextDocument doc;        /**     *  Create a new Message Element from the provided Document.     *     *  @param name Name of the Element. May be the empty string ("") or null if     *    the Element is not named.     *  @param doc A Document containing the contents of this element.     *  @param sig optional message digest/digital signature elemnent. If     *    no signature is to be specified, pass null.     **/    public TextDocumentMessageElement(String name, TextDocument doc, MessageElement sig) {        super( name, doc.getMimeType(), sig );                this.doc = doc;    }        /**     *  {@inheritDoc}     **/    public boolean equals( Object target ) {        if( this == target ) {            return true;        }                if( target instanceof MessageElement ) {            if( !super.equals(target) )                return false;                        if ( target instanceof TextMessageElement) {                // have to do a slow char by char comparison. Still better than the stream since it saves encoding.                // XXX 20020615 bondolo@jxta.org the performance of this could be much improved.                                TextMessageElement likeMe = (TextMessageElement) target;                                try {                    Reader myReader = getReader();                    Reader itsReader = likeMe.getReader();                                        int mine;                    int its;                    do {                        mine = myReader.read();                        its = itsReader.read();                                                if( mine != its )                            return false;       // content didn't match                                            } while( (-1 != mine) && (-1 != its) );                                        return ( (-1 == mine) && (-1 == its) ); // end at the same time?                } catch( IOException fatal ) {                    throw new IllegalStateException( "MessageElements could not be compared." + fatal );                }            } else {                // have to do a slow stream comparison.                // XXX 20020615 bondolo@jxta.org the performance of this could be much improved.                                MessageElement likeMe = (MessageElement) target;                                try {                    InputStream myStream = getStream();                    InputStream itsStream = likeMe.getStream();                                        int mine;                    int its;                    do {                        mine = myStream.read();                        its = itsStream.read();                                                if( mine != its )                            return false;       // content didn't match                                            } while( (-1 != mine) && (-1 != its) );                                        return ( (-1 == mine) && (-1 == its) ); // end at the same time?                } catch( IOException fatal ) {                    throw new IllegalStateException( "MessageElements could not be compared." + fatal );                }            }        }                return false; // not a new message element    }        /**     *  {@inheritDoc}     **/    public int hashCode() {        int result = super.hashCode() * 6037 + // a prime        toString().hashCode();                return result;    }        /**     *  {@inheritDoc}     **/    public synchronized String toString() {        String result = null;                if( null != cachedToString ) {            result = (String) cachedToString.get();                        if (null != result)                return result;        }                if (LOG.isEnabledFor(Level.DEBUG)){            LOG.debug( "creating toString of " + getClass().getName() + "@" + super.hashCode() );        }                result = doc.toString();        cachedToString = new SoftReference( result );        return result;    }        /**     * {@inheritDoc}     **/    public MimeMediaType getMimeType() {        return doc.getMimeType();    }        /**     * {@inheritDoc}     **/    public String getFileExtension() {        return doc.getFileExtension();    }        /**     *  {@inheritDoc}     **/    public InputStream getStream() throws IOException {        byte [] sending = getBytes(false);        return new ByteArrayInputStream(sending);    }        /**     *  {@inheritDoc}     **/    public void sendToStream( OutputStream sendTo ) throws IOException {        byte [] sending = getBytes(false);                sendTo.write( sending, 0, sending.length );    }        /**     *  {@inheritDoc}     **/    public Reader getReader() throws IOException {                return doc.getReader( );    }        /**     *  {@inheritDoc}     **/    public void sendToWriter( Writer sendTo ) throws IOException {        doc.sendToWriter( sendTo );    }        /**     *  {@inheritDoc}     **/    public byte[] getBytes( boolean copy ) {        byte [] result = null;                if( null != cachedGetBytes ) {            result = (byte []) cachedGetBytes.get();                        if (null != result)                if ( copy ) {                    byte [] theCopy = new byte[ result.length ];                                        System.arraycopy( theCopy, 0, result, 0, result.length );                } else {                    return result;                }        }                if (LOG.isEnabledFor(Level.DEBUG)){            LOG.debug( "creating getBytes of " + getClass().getName() + '@' + Integer.toHexString(hashCode())  );        }                String charset = type.getParameter( "charset" );                if( null == charset )            result = toString().getBytes( );        else {            try {                result = toString().getBytes( charset );            } catch( UnsupportedEncodingException caught ) {                if (LOG.isEnabledFor(Level.WARN)) {                    LOG.warn( "MessageElement Data could not be generated", caught );                }                throw new IllegalStateException( "MessageElement Data could not be generated due to " + caught.getMessage() );            }        }                // if this is supposed to be a shared buffer then we can cache it.        if( !copy ) {            cachedGetBytes = new SoftReference( result );        }                return result;    }        /**     *  {@inheritDoc}     **/    public long getCharLength() {        return toString().length();    }        /**     *  {@inheritDoc}     **/    public char[] getChars( boolean copy ) {        char [] result = null;                if( null != cachedGetChars ) {            result = (char []) cachedGetChars.get();                        if (null != result)                if ( copy ) {                    char [] theCopy = new char[ result.length ];                                        System.arraycopy( theCopy, 0, result, 0, result.length );                } else {                    return result;                }        }                if (LOG.isEnabledFor(Level.DEBUG)){            LOG.debug( "creating getChars of " + getClass().getName() + '@' + Integer.toHexString(hashCode())  );        }                String asString = toString();                result = asString.toCharArray();                // if this is supposed to be a shared buffer then we can cache it.        if( !copy ) {            cachedGetChars = new SoftReference( result );        }                return result;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美群妇大交群中文字幕| 色婷婷综合中文久久一本| 日韩黄色免费电影| 亚洲免费高清视频在线| 国产精品初高中害羞小美女文| 欧美激情一区二区在线| 亚洲精品国产精华液| 亚洲人123区| 一区二区三区不卡在线观看| 亚洲精品国产第一综合99久久| 亚洲欧美经典视频| 亚洲一卡二卡三卡四卡无卡久久| 亚洲主播在线播放| 午夜成人免费视频| 久久99精品久久久久久国产越南| 韩国成人在线视频| 成人av资源在线观看| 99精品久久只有精品| 色国产精品一区在线观看| 欧美视频在线播放| 日韩一级片网址| 欧美不卡一区二区| 亚洲国产精品成人综合| 欧美激情一区二区三区四区| 中文字幕在线播放不卡一区| 一区二区三区波多野结衣在线观看| 亚洲国产一区二区三区青草影视 | 亚洲一区二区三区在线看| 亚洲综合激情网| 日本午夜一区二区| 国产精品一区久久久久| 92国产精品观看| 欧美高清www午色夜在线视频| 日韩欧美卡一卡二| 国产精品久久久久永久免费观看 | www.久久精品| 欧美日韩aaaaaa| 久久婷婷久久一区二区三区| 综合久久综合久久| 日本特黄久久久高潮| 丰满少妇在线播放bd日韩电影| 欧美性猛交xxxx乱大交退制版| 日韩欧美色电影| 综合电影一区二区三区| 三级精品在线观看| 成人精品视频一区| 欧美日韩成人在线一区| 日本一区二区三区免费乱视频| 樱桃视频在线观看一区| 国内久久精品视频| 欧美三级中文字| 国产日韩欧美激情| 天堂精品中文字幕在线| thepron国产精品| 日韩一区二区不卡| 欧美激情在线一区二区| 日韩高清欧美激情| 99国产精品国产精品毛片| 日韩一二在线观看| 亚洲老司机在线| 精品亚洲porn| 欧美视频在线播放| 成人欧美一区二区三区| 久久99国产精品麻豆| 在线观看免费视频综合| 国产日产欧美精品一区二区三区| 日韩国产高清在线| 欧美中文字幕不卡| 国产精品久久久久一区二区三区共| 天天影视涩香欲综合网| av高清久久久| 国产色产综合色产在线视频| 天天av天天翘天天综合网色鬼国产| 国产福利一区二区三区| 日韩欧美不卡一区| 香蕉影视欧美成人| 在线观看日韩毛片| 亚洲免费在线看| 成人激情图片网| 久久这里只有精品6| 日本vs亚洲vs韩国一区三区二区 | 精品国产百合女同互慰| 亚洲国产日韩a在线播放| 91在线看国产| 国产亚洲成aⅴ人片在线观看| 九一九一国产精品| 日韩区在线观看| 日韩电影网1区2区| 欧美女孩性生活视频| 一卡二卡欧美日韩| 色欧美乱欧美15图片| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 99精品在线免费| 国产欧美日韩在线观看| 国产精品99久久久久久久vr | 国产精品私人自拍| 国产一区二区h| 久久夜色精品国产欧美乱极品| 日本sm残虐另类| 日韩一级黄色片| 日韩不卡在线观看日韩不卡视频| 欧美性生活大片视频| 亚洲最快最全在线视频| 91久久久免费一区二区| 亚洲免费三区一区二区| 日本精品免费观看高清观看| 亚洲另类色综合网站| 欧美在线|欧美| 亚洲高清久久久| 56国语精品自产拍在线观看| 日本在线不卡视频| 欧美成人一区二区| 国产剧情一区二区三区| 久久久久久久久久久久电影 | 欧美偷拍一区二区| 午夜成人免费视频| 精品剧情v国产在线观看在线| 精品无码三级在线观看视频| 久久这里只有精品首页| 不卡的av中国片| 亚洲精品中文字幕乱码三区| 欧美亚洲尤物久久| 美女爽到高潮91| 欧美国产成人精品| 一本色道久久综合亚洲aⅴ蜜桃| 一区二区三区四区视频精品免费 | 亚洲精品网站在线观看| 欧美色老头old∨ideo| 日韩高清在线电影| 国产婷婷一区二区| 欧美在线免费观看亚洲| 美女被吸乳得到大胸91| 国产女人18水真多18精品一级做| 91片在线免费观看| 午夜视频一区在线观看| 欧美大黄免费观看| 99综合影院在线| 婷婷国产在线综合| 国产精品女同一区二区三区| 欧洲另类一二三四区| 青青青伊人色综合久久| 久久久国产午夜精品| 91久久国产最好的精华液| 免费在线看成人av| 国产精品国产三级国产aⅴ中文 | 国产欧美精品一区aⅴ影院 | 在线综合视频播放| 成人永久aaa| 偷拍自拍另类欧美| 国产欧美精品一区二区色综合朱莉| 色偷偷成人一区二区三区91| 老司机午夜精品| 国产精品不卡在线观看| 91麻豆精品国产91久久久资源速度 | 国产一区二区0| 亚洲午夜在线视频| 国产女主播在线一区二区| 欧美日韩日日骚| 国产成人av影院| 婷婷成人激情在线网| 国产精品毛片无遮挡高清| 欧美夫妻性生活| 白白色 亚洲乱淫| 精品在线免费观看| 亚洲一区二区三区在线看| 欧美国产成人精品| 日韩精品一区国产麻豆| 色综合天天综合狠狠| 国产美女视频一区| 日韩高清在线一区| 一区二区三区精品| 国产欧美日韩中文久久| 欧美va亚洲va国产综合| 欧美亚州韩日在线看免费版国语版| 丁香婷婷综合网| 六月婷婷色综合| 午夜精品免费在线| 亚洲激情中文1区| 欧美极品xxx| 精品少妇一区二区三区在线播放 | 欧美一区二区视频免费观看| 99精品欧美一区二区蜜桃免费| 国产呦萝稀缺另类资源| 日韩av一二三| 亚洲成人福利片| 一区二区三区中文免费| 中文字幕一区二区三区av| 久久精品视频网| 精品美女在线播放| 日韩一区国产二区欧美三区| 欧美人伦禁忌dvd放荡欲情| 色综合中文字幕| www.66久久| 99视频精品全部免费在线| 国产成人小视频| 丁香啪啪综合成人亚洲小说| 国内精品久久久久影院色 | 91免费观看在线| 色综合天天做天天爱| 菠萝蜜视频在线观看一区|