亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩影院精彩在线| 日本不卡一区二区三区高清视频| 亚洲精品久久7777| 精品一区二区三区视频在线观看| 99久久精品免费看| 日韩午夜av一区| 亚洲最新在线观看| eeuss鲁片一区二区三区| 91精品国产高清一区二区三区 | 亚洲色图清纯唯美| 国产一区二区三区不卡在线观看 | 精品福利在线导航| 偷拍亚洲欧洲综合| 色综合久久88色综合天天免费| 久久久99精品久久| 九九久久精品视频| 欧美一区二区二区| 日韩精品一二三区| 欧美日本不卡视频| 性做久久久久久免费观看欧美| 91首页免费视频| 亚洲人成伊人成综合网小说| 成人高清视频在线观看| 国产日韩欧美精品综合| 国产一区二区中文字幕| 日韩精品中文字幕在线一区| 日韩主播视频在线| 欧美一区二区网站| 久久精品国产秦先生| 日韩视频一区二区在线观看| 日本欧美一区二区| 欧美一级爆毛片| 国产综合色视频| 2022国产精品视频| 成人黄页在线观看| 亚洲视频一区在线| 91麻豆免费观看| 亚洲综合成人在线视频| 欧美亚洲自拍偷拍| 午夜久久久久久久久| 91精品福利在线一区二区三区 | 日韩欧美自拍偷拍| 久久精品99国产精品| 精品国产乱码久久久久久免费| 国产综合一区二区| 中文字幕在线不卡一区| 日本韩国一区二区三区视频| 亚洲高清三级视频| 欧美大片在线观看| 不卡视频一二三四| 亚洲一区二区三区四区的 | 日本一区二区视频在线观看| 不卡的av网站| 日韩精品一二区| 久久蜜桃av一区精品变态类天堂| 国产91精品一区二区| 亚洲精品国产精华液| 欧美一区二区免费视频| 国产精品99久久久久| 亚洲免费观看高清| 欧美www视频| 91丨porny丨蝌蚪视频| 免费久久99精品国产| 国产精品美女一区二区| 欧美日本在线看| 国产成人av一区二区三区在线 | 在线视频你懂得一区| 天堂精品中文字幕在线| 亚洲国产精品成人综合| 欧美日本国产视频| kk眼镜猥琐国模调教系列一区二区| 香蕉成人伊视频在线观看| 欧美精品一区二区三区在线播放 | 亚洲综合一区在线| 亚洲精品在线免费观看视频| 色天使久久综合网天天| 麻豆精品视频在线观看免费| 成人免费在线视频观看| 日韩精品一区在线观看| 91久久国产综合久久| 国产东北露脸精品视频| 日本亚洲免费观看| 一区二区三区欧美| 国产精品丝袜久久久久久app| 欧美一级淫片007| 色老汉一区二区三区| 国产成人免费在线视频| 美美哒免费高清在线观看视频一区二区| 中文字幕一区二区三中文字幕| 精品久久久三级丝袜| 在线播放欧美女士性生活| 91免费看片在线观看| 成人永久aaa| 国产精品一卡二卡| 激情久久五月天| 另类欧美日韩国产在线| 首页国产丝袜综合| 亚洲国产精品久久人人爱| 亚洲美腿欧美偷拍| 自拍偷拍欧美精品| 国产精品无码永久免费888| 精品区一区二区| 欧美电视剧在线看免费| 欧美一级一区二区| 日韩欧美123| 日韩亚洲欧美一区| 欧美不卡视频一区| 亚洲精品一线二线三线无人区| 日韩一区和二区| 日韩欧美第一区| 精品少妇一区二区三区在线播放| 欧美日本在线看| 日韩一区二区在线免费观看| 日韩一区和二区| 日韩欧美国产综合在线一区二区三区| 26uuu精品一区二区在线观看| 日韩亚洲欧美综合| 日韩午夜在线观看视频| 欧美xxxx老人做受| 日韩一区二区视频在线观看| 在线精品亚洲一区二区不卡| 国产iv一区二区三区| 欧美大片一区二区| 成人美女在线观看| 亚洲欧洲韩国日本视频| caoporn国产一区二区| 精品电影一区二区三区| 国产aⅴ综合色| 日本不卡一区二区三区高清视频| 丝袜美腿亚洲一区二区图片| 日韩av一区二区在线影视| 另类的小说在线视频另类成人小视频在线| 久久国产婷婷国产香蕉| 国产成人8x视频一区二区| 99精品欧美一区二区三区小说| 91久久精品一区二区三区| 欧美一级黄色录像| 欧美激情一区不卡| 亚洲福利一二三区| 美女国产一区二区| av电影在线不卡| 欧美一区二区三区喷汁尤物| 久久精品亚洲精品国产欧美| 亚洲免费大片在线观看| 美女视频一区二区| 成人福利视频网站| 欧美乱妇一区二区三区不卡视频| 2020国产精品| 亚洲一二三四在线观看| 精品一区二区三区影院在线午夜| 99国产欧美久久久精品| 日韩一区二区三区视频| 国产网站一区二区三区| 午夜欧美电影在线观看| 东方欧美亚洲色图在线| 欧美女孩性生活视频| 中文字幕免费不卡| 日本亚洲视频在线| 日本高清无吗v一区| 精品国产一区久久| 亚洲午夜久久久久中文字幕久| 国产精品资源网| 欧美乱妇23p| 综合网在线视频| 国产老肥熟一区二区三区| 欧美自拍偷拍午夜视频| 国产欧美日韩不卡免费| 日韩电影在线免费| 色八戒一区二区三区| 久久久久久亚洲综合影院红桃| 亚洲不卡一区二区三区| 成人国产免费视频| 精品剧情v国产在线观看在线| 亚洲最新在线观看| 99re66热这里只有精品3直播| 精品国产一区二区三区av性色| 亚洲第一激情av| 一本色道**综合亚洲精品蜜桃冫| 国产人久久人人人人爽| 毛片基地黄久久久久久天堂| 在线视频一区二区三区| 亚洲天堂成人在线观看| 国产精品 日产精品 欧美精品| 欧美电影一区二区| 午夜精彩视频在线观看不卡| 日本韩国欧美在线| 亚洲精品乱码久久久久久日本蜜臀| 成人听书哪个软件好| 久久影院午夜论| 国内精品第一页| 久久综合给合久久狠狠狠97色69| 蜜臂av日日欢夜夜爽一区| 欧美一级日韩免费不卡| 天天综合色天天| 欧美高清dvd| 另类小说一区二区三区| 日韩三级av在线播放| 裸体一区二区三区| 欧美大片日本大片免费观看| 久久国产精品一区二区|