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

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

?? bytesmessageimpl.java

?? 一個java方面的消息訂閱發送的源碼
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/**
 * Redistribution and use of this software and associated documentation
 * ("Software"), with or without modification, are permitted provided
 * that the following conditions are met:
 *
 * 1. Redistributions of source code must retain copyright
 *    statements and notices.  Redistributions must also contain a
 *    copy of this document.
 *
 * 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 name "Exolab" must not be used to endorse or promote
 *    products derived from this Software without prior written
 *    permission of Exoffice Technologies.  For written permission,
 *    please contact info@exolab.org.
 *
 * 4. Products derived from this Software may not be called "Exolab"
 *    nor may "Exolab" appear in their names without prior written
 *    permission of Exoffice Technologies. Exolab is a registered
 *    trademark of Exoffice Technologies.
 *
 * 5. Due credit should be given to the Exolab Project
 *    (http://www.exolab.org/).
 *
 * THIS SOFTWARE IS PROVIDED BY EXOFFICE TECHNOLOGIES AND CONTRIBUTORS
 * ``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
 * EXOFFICE TECHNOLOGIES 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.
 *
 * Copyright 2000-2005 (C) Exoffice Technologies Inc. All Rights Reserved.
 *
 * $Id: BytesMessageImpl.java,v 1.2 2005/03/18 03:50:12 tanderson Exp $
 */
package org.exolab.jms.message;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.EOFException;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.UTFDataFormatException;

import javax.jms.BytesMessage;
import javax.jms.JMSException;
import javax.jms.MessageEOFException;
import javax.jms.MessageFormatException;
import javax.jms.MessageNotReadableException;
import javax.jms.MessageNotWriteableException;


/**
 * This class implements the {@link BytesMessage} interface.
 *
 * @version     $Revision: 1.2 $ $Date: 2005/03/18 03:50:12 $
 * @author      <a href="mailto:mourikis@intalio.com">Jim Mourikis</a>
 * @author      <a href="mailto:tima@netspace.net.au">Tim Anderson</a>
 * @see         BytesMessage
 */
public final class BytesMessageImpl extends MessageImpl
    implements BytesMessage {

    /**
     * Object version no. for serialization.
     */
    static final long serialVersionUID = 1;

    /**
     * Empty byte array for initialisation purposes.
     */
    private static final byte[] EMPTY = new byte[]{};

    /**
     * The byte stream to store data.
     */
    private byte[] _bytes = EMPTY;

    /**
     * The stream used for writes.
     */
    private DataOutputStream _out = null;

    /**
     * The byte stream backing the output stream.
     */
    private ByteArrayOutputStream _byteOut = null;

    /**
     * The stream used for reads.
     */
    private DataInputStream _in = null;

    /**
     * The byte stream backing the input stream.
     */
    private ByteArrayInputStream _byteIn = null;

    /**
     * The offset of the byte stream to start reading from. This defaults
     * to 0, and only applies to messages that are cloned from a
     * read-only instance where part of the stream had already been read.
     */
    private int _offset = 0;

    /**
     * Construct a new BytesMessage. When first created, the message is in
     * write-only mode.
     *
     * @throws JMSException if the message type can't be set
     */
    public BytesMessageImpl() throws JMSException {
        setJMSType("BytesMessage");
    }

    /**
     * Clone an instance of this object.
     *
     * @return a copy of this object
     * @throws CloneNotSupportedException if object or attributes aren't
     * cloneable
     */
    public final Object clone() throws CloneNotSupportedException {
        BytesMessageImpl result = (BytesMessageImpl) super.clone();
        if (_bodyReadOnly) {
            result._bytes = new byte[_bytes.length];
            System.arraycopy(_bytes, 0, result._bytes, 0, _bytes.length);
            if (_byteIn != null) {
                // if a client subsequently reads from the cloned object,
                // start reading from offset of the original stream
                _offset = _bytes.length - _byteIn.available();
            }
            result._byteIn = null;
            result._in = null;
        } else {
            if (_out != null) {
                try {
                    _out.flush();
                } catch (IOException exception) {
                    throw new CloneNotSupportedException(
                        exception.getMessage());
                }
                result._bytes = _byteOut.toByteArray();
                result._byteOut = null;
                result._out = null;
            } else {
                result._bytes = new byte[_bytes.length];
                System.arraycopy(_bytes, 0, result._bytes, 0, _bytes.length);
            }
        }

        return result;
    }

    /**
     * Serialize out this message's data.
     *
     * @param out the stream to serialize out to
     * @throws IOException if any I/O exceptions occurr
     */
    public final void writeExternal(ObjectOutput out) throws IOException {
        // If it was in write mode, extract the byte array.
        if (!_bodyReadOnly && _out != null) {
            _out.flush();
            _bytes = _byteOut.toByteArray();
        }

        super.writeExternal(out);
        out.writeLong(serialVersionUID);
        out.writeInt(_bytes.length);
        out.write(_bytes);
        out.flush();
    }

    /**
     * Serialize in this message's data.
     *
     * @param in the stream to serialize in from
     * @throws ClassNotFoundException if the class for an object being
     * restored cannot be found.
     * @throws IOException if any I/O exceptions occur
     */
    public final void readExternal(ObjectInput in)
        throws ClassNotFoundException, IOException {
        super.readExternal(in);
        long version = in.readLong();
        if (version == serialVersionUID) {
            int length = in.readInt();
            _bytes = new byte[length];
            in.readFully(_bytes);
        } else {
            throw new IOException("Incorrect version enountered: " + version +
                ". This version = " + serialVersionUID);
        }
    }

    /**
     * Gets the number of bytes of the message body when the message is in
     * read-only mode. The value returned can be used to allocate a byte array.
     * The value returned is the entire length of the message body, regardless
     * of where the pointer for reading the message is currently located.
     *
     * @return number of bytes in the message
     * @throws JMSException                if the JMS provider fails to read the
     *                                     message due to some internal error.
     * @throws MessageNotReadableException if the message is in write-only
     *                                     mode.
     */

    public long getBodyLength() throws JMSException {
        checkRead();
        return _bytes.length;
    }

    /**
     * Read a <code>boolean</code> from the bytes message stream.
     *
     * @return the <code>boolean</code> value read
     * @throws JMSException if JMS fails to read message due to some internal
     * JMS error
     * @throws MessageEOFException if end of bytes stream
     * @throws MessageNotReadableException if message is in write-only mode
     */
    public final boolean readBoolean() throws JMSException {
        boolean result = false;
        prepare();
        try {
            result = _in.readBoolean();
        } catch (IOException exception) {
            revert(exception);
        }
        return result;
    }

    /**
     * Read a signed 8-bit value from the bytes message stream.
     *
     * @return the next byte from the bytes message stream as a signed 8-bit
     * <code>byte</code>
     * @throws JMSException if JMS fails to read message due to some internal
     * JMS error
     * @throws MessageEOFException if end of message stream
     * @throws MessageNotReadableException if message is in write-only mode
     */
    public final byte readByte() throws JMSException {
        byte result = 0;
        prepare();
        try {
            result = _in.readByte();
        } catch (IOException exception) {
            revert(exception);
        }
        return result;
    }

    /**
     * Read an unsigned 8-bit number from the bytes message stream.
     *
     * @return the next byte from the bytes message stream, interpreted as an
     * unsigned 8-bit number
     * @throws JMSException if JMS fails to read message due to some internal
     * JMS error
     * @throws MessageNotReadableException if message is in write-only mode
     * @throws MessageEOFException if end of message stream
     */
    public final int readUnsignedByte() throws JMSException {
        int result = 0;
        prepare();
        try {
            result = _in.readUnsignedByte();
        } catch (IOException exception) {
            revert(exception);
        }
        return result;
    }

    /**
     * Read a signed 16-bit number from the bytes message stream.
     *
     * @return the next two bytes from the bytes message stream, interpreted
     * as a signed 16-bit number
     * @throws JMSException if JMS fails to read message due to some internal
     * JMS error
     * @throws MessageEOFException if end of message stream
     * @throws MessageNotReadableException if message is in write-only mode
     */
    public final short readShort() throws JMSException {
        short result = 0;
        prepare();
        try {
            result = _in.readShort();
        } catch (IOException exception) {
            revert(exception);
        }
        return result;
    }

    /**
     * Read an unsigned 16-bit number from the bytes message stream.
     *
     * @return the next two bytes from the bytes message stream, interpreted
     * as an unsigned 16-bit integer
     *
     * @throws JMSException if JMS fails to read message due to some internal
     * JMS error
     * @throws MessageEOFException if end of message stream
     * @throws MessageNotReadableException if message is in write-only mode
     */
    public final int readUnsignedShort() throws JMSException {
        int result = 0;
        prepare();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人精品高清在线播放| 国产精品久久久一区麻豆最新章节| 国产精品一二三| 亚洲午夜精品久久久久久久久| 久久人人超碰精品| 91麻豆精品91久久久久久清纯 | 久久成人免费日本黄色| 国产精品理论在线观看| 日韩欧美一区二区在线视频| 一本色道**综合亚洲精品蜜桃冫 | 日产精品久久久久久久性色| 亚洲三级久久久| 欧美激情一区二区三区蜜桃视频 | 91毛片在线观看| 国产精品1024久久| 久久99精品久久只有精品| 亚洲一二三四在线观看| 日韩毛片在线免费观看| 国产精品另类一区| 国产色91在线| 国产午夜精品一区二区| 精品裸体舞一区二区三区| 欧美丰满嫩嫩电影| 欧美天天综合网| 欧美午夜精品免费| 欧美视频一区二| 色哟哟在线观看一区二区三区| 高清不卡一二三区| 国产成人免费在线| 成人免费视频播放| 国产不卡视频一区二区三区| 国内精品久久久久影院薰衣草| 午夜精品福利一区二区蜜股av| 亚洲精品日韩一| 亚洲乱码精品一二三四区日韩在线| 国产精品素人一区二区| 中文字幕免费观看一区| 中文字幕精品一区二区三区精品 | 一区二区三区四区激情| 最近日韩中文字幕| 亚洲卡通动漫在线| 亚洲精品成人悠悠色影视| 伊人开心综合网| 亚洲国产wwwccc36天堂| 日韩高清欧美激情| 裸体在线国模精品偷拍| 狠狠色综合播放一区二区| 国产盗摄一区二区| eeuss影院一区二区三区| jlzzjlzz欧美大全| 色综合一个色综合| 欧美日韩一区二区三区四区五区| 欧美妇女性影城| 亚洲精品在线免费播放| 国产视频在线观看一区二区三区| 中文字幕精品三区| 一区二区三区色| 日韩和欧美一区二区| 九色|91porny| 成人在线一区二区三区| 色婷婷亚洲婷婷| 欧美电影在哪看比较好| 精品久久久久久久久久久久包黑料 | 91国产丝袜在线播放| 欧美性生活久久| 日韩网站在线看片你懂的| 欧美国产欧美亚州国产日韩mv天天看完整| 亚洲欧洲日韩一区二区三区| 亚洲成人免费观看| 激情六月婷婷久久| 色综合一区二区| 日韩精品一区二区三区四区视频| 国产日韩亚洲欧美综合| 亚洲一区二区三区不卡国产欧美| 美女视频免费一区| 粉嫩av一区二区三区在线播放| 欧洲精品一区二区| 久久毛片高清国产| 亚洲成人综合视频| 成人小视频在线观看| 欧美日韩一区 二区 三区 久久精品| 亚洲精品一区在线观看| 亚洲欧洲精品一区二区精品久久久 | 色狠狠色噜噜噜综合网| 欧美本精品男人aⅴ天堂| 成人欧美一区二区三区1314| 青青青爽久久午夜综合久久午夜| 大胆亚洲人体视频| 在线成人高清不卡| 国产精品理论片在线观看| 日日摸夜夜添夜夜添精品视频| 国产 日韩 欧美大片| 69堂国产成人免费视频| 中文字幕一区二区三区不卡| 免费亚洲电影在线| 色视频成人在线观看免| 国产调教视频一区| 免费观看在线综合色| 99国产欧美另类久久久精品| 欧美大片顶级少妇| 午夜精品久久久久久久99水蜜桃| av激情亚洲男人天堂| 精品久久久久久久久久久久包黑料 | 久久亚洲一区二区三区明星换脸 | 国产成人亚洲精品青草天美| 欧美一区二区三区视频在线观看| 亚洲欧洲99久久| 国产精品夜夜嗨| 日韩一区二区在线看片| 亚洲成人动漫av| 色综合天天综合网国产成人综合天| 久久久综合视频| 精品在线亚洲视频| 91精品国产品国语在线不卡| 亚洲自拍偷拍av| 色婷婷精品大在线视频| 中文字幕中文字幕在线一区 | 色综合久久久久综合| 欧美极品aⅴ影院| 国产精品99久久久| 欧美精品一区二区蜜臀亚洲| 日产欧产美韩系列久久99| 欧美日本一道本在线视频| 一区二区三区在线不卡| 日本韩国欧美一区二区三区| 中文字幕在线观看不卡| 成人激情免费电影网址| 久久久亚洲国产美女国产盗摄| 国产在线不卡视频| 久久久久国产精品人| 国产aⅴ综合色| 中文一区在线播放| 99国产精品国产精品久久| 亚洲欧美色一区| 色吧成人激情小说| 亚洲丰满少妇videoshd| 欧美高清激情brazzers| 麻豆精品国产91久久久久久| 精品国产欧美一区二区| 国产精品影视在线观看| 国产精品免费aⅴ片在线观看| 国产.欧美.日韩| 亚洲日本青草视频在线怡红院| 99久久精品免费精品国产| 一区二区三区久久久| 欧美日韩另类国产亚洲欧美一级| 五月综合激情网| 精品日韩欧美在线| 高清av一区二区| 亚洲免费av网站| 欧美日韩国产首页在线观看| 日本不卡视频一二三区| 2023国产精品视频| jlzzjlzz欧美大全| 亚洲一区二区三区四区中文字幕| 91精品国产一区二区三区| 久久精品国产成人一区二区三区 | 热久久一区二区| 国产日韩成人精品| 色婷婷综合久久久中文字幕| 日韩—二三区免费观看av| 精品福利二区三区| 91香蕉视频在线| 午夜国产不卡在线观看视频| 久久久久久久久岛国免费| 91视视频在线直接观看在线看网页在线看 | www.久久精品| 亚洲国产精品麻豆| 久久精品一区二区| 91久久精品一区二区二区| 日产国产高清一区二区三区| 欧美国产日韩亚洲一区| 欧美在线一区二区| 精品一区二区三区久久| 亚洲天堂网中文字| 欧美一区二区三区日韩视频| 风流少妇一区二区| 性做久久久久久久免费看| 久久久久久久久久久久久久久99 | 色哟哟国产精品| 国产真实精品久久二三区| 一区二区成人在线视频| 久久网站热最新地址| 欧美在线视频全部完| 国产精品一区二区你懂的| 亚洲丰满少妇videoshd| 国产精品久线在线观看| 91精品国产欧美一区二区 | 欧美一区二区三区四区视频| 99久久99久久精品免费观看| 免费在线观看成人| 亚洲韩国精品一区| 国产精品嫩草影院av蜜臀| 欧美一区二区美女| 在线观看一区二区视频| 波多野结衣在线aⅴ中文字幕不卡| 天天色天天爱天天射综合| 亚洲欧美国产三级| 欧美高清在线视频| 久久综合色8888|