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

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

?? streammessageimpl.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-2004 (C) Exoffice Technologies Inc. All Rights Reserved.
 *
 * $Id: StreamMessageImpl.java,v 1.2 2005/05/24 13:27:10 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 javax.jms.JMSException;
import javax.jms.MessageEOFException;
import javax.jms.MessageFormatException;
import javax.jms.MessageNotReadableException;
import javax.jms.MessageNotWriteableException;
import javax.jms.StreamMessage;


/**
 * This class implements the {@link javax.jms.StreamMessage} interface.
 * <p>
 * A StreamMessage is used to send a stream of Java primitives.
 * It is filled and read sequentially. It inherits from <code>Message</code>
 * and adds a stream message body. It's methods are based largely on those
 * found in <code>java.io.DataInputStream</code> and
 * <code>java.io.DataOutputStream</code>.
 * <p>
 * The primitive types can be read or written explicitly using methods
 * for each type. They may also be read or written generically as objects.
 * For instance, a call to <code>StreamMessage.writeInt(6)</code> is
 * equivalent to <code>StreamMessage.writeObject(new Integer(6))</code>.
 * Both forms are provided because the explicit form is convenient for
 * static programming and the object form is needed when types are not known
 * at compile time.
 * <p>
 * When the message is first created, and when {@link #clearBody}
 * is called, the body of the message is in write-only mode. After the
 * first call to {@link #reset} has been made, the message body is in
 * read-only mode. When a message has been sent, by definition, the
 * provider calls <code>reset</code> in order to read it's content, and
 * when a message has been received, the provider has called
 * <code>reset</code> so that the message body is in read-only mode for the
 * client.
 * <p>
 * If {@link #clearBody} is called on a message in read-only mode,
 * the message body is cleared and the message body is in write-only mode.
 * <p>
 * If a client attempts to read a message in write-only mode, a
 * MessageNotReadableException is thrown.
 * <p>
 * If a client attempts to write a message in read-only mode, a
 * MessageNotWriteableException is thrown.
 * <p>
 * Stream messages support the following conversion table. The marked cases
 * must be supported. The unmarked cases must throw a JMSException. The
 * String to primitive conversions may throw a runtime exception if the
 * primitives <code>valueOf()</code> method does not accept it as a valid
 * String representation of the primitive.
 * <p>
 * A value written as the row type can be read as the column type.
 *
 * <pre>
 * |        | boolean byte short char int long float double String byte[]
 * |----------------------------------------------------------------------
 * |boolean |    X                                            X
 * |byte    |          X     X         X   X                  X
 * |short   |                X         X   X                  X
 * |char    |                     X                           X
 * |int     |                          X   X                  X
 * |long    |                              X                  X
 * |float   |                                    X     X      X
 * |double  |                                          X      X
 * |String  |    X     X     X         X   X     X     X      X
 * |byte[]  |                                                        X
 * |----------------------------------------------------------------------
 * </pre>
 * <p>
 * Attempting to read a null value as a Java primitive type must be treated
 * as calling the primitive's corresponding <code>valueOf(String)</code>
 * conversion method with a null value. Since char does not support a String
 * conversion, attempting to read a null value as a char must throw
 * NullPointerException.
 *
 * @version     $Revision: 1.2 $ $Date: 2005/05/24 13:27:10 $
 * @author      <a href="mailto:mourikis@intalio.com">Jim Mourikis</a>
 * @author      <a href="mailto:tma@netspace.net.au">Tim Anderson</a>
 * @see         javax.jms.StreamMessage
 */
public final class StreamMessageImpl extends MessageImpl
    implements StreamMessage {

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

    /**
     * Type codes
     */
    private static final byte NULL = 0;
    private static final byte BOOLEAN = 1;
    private static final byte BYTE = 2;
    private static final byte BYTE_ARRAY = 3;
    private static final byte SHORT = 4;
    private static final byte CHAR = 5;
    private static final byte INT = 6;
    private static final byte LONG = 7;
    private static final byte FLOAT = 8;
    private static final byte DOUBLE = 9;
    private static final byte STRING = 10;

    /**
     * String values representing the above type codes, for error reporting
     * purposes
     */
    private static final String[] TYPE_NAMES = {
        "null", "boolean", "byte", "byte[]", "short", "char", "int", "long",
        "float", "double", "String"};

    /**
     * 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;

    /**
     * Non-zero if incrementally reading a byte array using
     * {@link #readBytes(byte[])}
     */
    private int _readBytes = 0;

    /**
     * The length of the byte array being read using {@link #readBytes(byte[])}
     */
    private int _byteArrayLength = 0;

    /**
     * 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 StreamMessage. When first created, the message is in
     * write-only mode.
     *
     * @throws JMSException if the message type can't be set, or an I/O error
     * occurs
     */
    public StreamMessageImpl() throws JMSException {
        setJMSType("StreamMessage");
    }

    /**
     * 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 {
        StreamMessageImpl result = (StreamMessageImpl) 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);
        }
    }

    /**
     * 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 message stream
     * @throws MessageFormatException if this type conversion is invalid
     * @throws MessageNotReadableException if message is in write-only mode
     */
    public final boolean readBoolean() throws JMSException {
        boolean result = false;
        prepare();
        try {
            result = FormatConverter.getBoolean(readNext());
        } catch (MessageFormatException exception) {
            revert(exception);
        }
        return result;
    }

    /**
     * Read a byte value from the stream message
     *
     * @return the next byte from the stream message as an 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 MessageFormatException if this type conversion is invalid
     * @throws MessageNotReadableException if message is in write-only mode
     * @throws NumberFormatException if numeric conversion is invalid
     */
    public final byte readByte() throws JMSException {
        byte result = 0;
        prepare();
        try {
            result = FormatConverter.getByte(readNext());
        } catch (MessageFormatException exception) {
            revert(exception);
        } catch (NumberFormatException exception) {
            revert(exception);
        }
        return result;
    }

    /**
     * Read a 16-bit number from the stream message.
     *
     * @return a 16-bit number from the stream message
     * @throws JMSException if JMS fails to read message due to some internal
     * JMS error
     * @throws MessageEOFException if end of message stream
     * @throws MessageFormatException if this type conversion is invalid
     * @throws MessageNotReadableException if message is in write-only mode
     * @throws NumberFormatException if numeric conversion is invalid
     */
    public final short readShort() throws JMSException {
        short result = 0;
        prepare();
        try {
            result = FormatConverter.getShort(readNext());
        } catch (MessageFormatException exception) {
            revert(exception);
        } catch (NumberFormatException exception) {
            revert(exception);
        }
        return result;
    }

    /*
     * Read a Unicode character value from the stream message
     *
     * @return a Unicode character from the stream message
     * @throws JMSException if JMS fails to read message due to some internal
     * JMS error
     * @throws MessageEOFException if end of message stream
     * @throws MessageFormatException if this type conversion is invalid
     * @throws MessageNotReadableException if message is in write-only mode
     */
    public final char readChar() throws JMSException {
        char result = 0;
        prepare();
        try {
            result = FormatConverter.getChar(readNext());
        } catch (MessageFormatException exception) {
            revert(exception);
        } catch (NullPointerException exception) {
            revert(exception);
        }
        return result;
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线不卡的av| 欧美视频你懂的| 日韩影院在线观看| 国产精品久久久久影院老司| 国产欧美视频在线观看| 国产亚洲精品精华液| 久久人人超碰精品| 久久久噜噜噜久久人人看 | 欧美日韩国产一级| 色噜噜偷拍精品综合在线| 色综合视频在线观看| 在线观看国产日韩| 91精品国产91久久久久久一区二区| 欧美日韩一区二区在线视频| 777亚洲妇女| 久久色在线观看| 久久久久久毛片| 中文字幕日韩一区二区| 一区二区三区**美女毛片| 午夜欧美电影在线观看| 青青草97国产精品免费观看无弹窗版| 日本aⅴ免费视频一区二区三区 | 中文字幕二三区不卡| 亚洲同性gay激情无套| 夜夜夜精品看看| 日韩国产精品久久久| 国产精品一区一区三区| 懂色一区二区三区免费观看| 91浏览器入口在线观看| 欧美撒尿777hd撒尿| 欧美精品一区二区三区蜜桃| 国产精品亲子伦对白| 亚洲成人在线网站| 国产在线乱码一区二区三区| 99久久综合精品| 制服丝袜亚洲网站| 欧美高清在线精品一区| 日韩精品高清不卡| 国产白丝精品91爽爽久久| 欧美日韩一级大片网址| 国产丝袜欧美中文另类| 亚洲国产精品久久久男人的天堂| 蜜桃一区二区三区在线| 色综合天天做天天爱| 精品国产免费久久| 午夜欧美视频在线观看| 99久精品国产| 精品国产乱码久久久久久图片 | 成人精品视频一区| 欧美一区二区视频在线观看 | 99热99精品| 日韩一区二区三区精品视频| 亚洲人成网站精品片在线观看| 日本视频免费一区| 欧美在线免费播放| 中文字幕一区在线观看| 国模冰冰炮一区二区| 在线电影欧美成精品| 亚洲欧美日韩国产手机在线| 国产成人一区在线| 精品免费日韩av| 亚洲一线二线三线视频| 91蜜桃网址入口| 国产亚洲精品精华液| 激情综合网av| 欧美乱妇20p| 一区二区三区精品视频在线| 成人av资源在线| 国产午夜精品一区二区| 精品亚洲国内自在自线福利| 欧美二区三区的天堂| 尤物视频一区二区| 91精品办公室少妇高潮对白| 亚洲欧洲国产专区| 丁香婷婷综合网| 国产精品私房写真福利视频| 美女视频一区在线观看| 日韩欧美精品在线| 日本亚洲欧美天堂免费| 69堂国产成人免费视频| 日韩精品一二三区| 日韩视频123| 国内国产精品久久| 国产欧美精品一区| 成人免费精品视频| 亚洲免费观看高清| 在线亚洲一区观看| 亚洲成人av一区二区| 欧美麻豆精品久久久久久| 日韩av在线免费观看不卡| 日韩午夜激情av| 经典一区二区三区| 中文字幕一区二区三区av| 91亚洲精品久久久蜜桃| 亚洲乱码国产乱码精品精98午夜 | 精品久久久久久久久久久久包黑料| 亚洲国产精品视频| 日韩欧美国产综合一区| 国产精品白丝jk黑袜喷水| 中文字幕日韩av资源站| 欧美三级一区二区| 紧缚奴在线一区二区三区| 国产精品乱码妇女bbbb| 欧美三级电影在线看| 久久99精品视频| 亚洲女人****多毛耸耸8| 欧美午夜免费电影| 狠狠狠色丁香婷婷综合激情| 亚洲视频一区在线| 欧美一区二区三区四区在线观看 | 黄一区二区三区| 18涩涩午夜精品.www| 欧美一区二区三区视频| 国产成人精品免费看| 亚洲成人av一区二区三区| 欧美精品一区二区三区蜜桃视频 | 亚洲视频在线一区| 91精品国产综合久久久蜜臀粉嫩| 国产专区欧美精品| 性久久久久久久| 国产精品国产自产拍高清av王其| 欧美高清dvd| 成人18视频日本| 免费的国产精品| 亚洲综合色噜噜狠狠| 国产日产欧美一区二区三区 | 精品国产乱码久久久久久久久| 成人手机在线视频| 久久精品国产亚洲aⅴ| 亚洲精品国产第一综合99久久| 久久综合色婷婷| 91精品国产乱码久久蜜臀| thepron国产精品| 久草这里只有精品视频| 亚洲大片免费看| 亚洲综合一区在线| 中文幕一区二区三区久久蜜桃| 日韩精品一区二区三区视频| 成人动漫视频在线| 国产乱码精品一区二区三| 亚洲妇女屁股眼交7| 亚洲男人的天堂在线观看| 2021中文字幕一区亚洲| 日韩午夜小视频| 精品视频一区 二区 三区| 91美女在线看| 波多野结衣亚洲| 成人中文字幕合集| 国产成人免费av在线| 久久精品国产久精国产爱| 亚洲成人高清在线| 亚洲一二三专区| 亚洲午夜久久久久久久久电影院| 综合久久给合久久狠狠狠97色| 久久精品一区二区三区不卡 | 99国产一区二区三精品乱码| 老司机免费视频一区二区| 亚洲国产日产av| 亚洲午夜久久久久久久久久久| 蜜臀91精品一区二区三区| 首页国产欧美日韩丝袜| 午夜激情久久久| 日韩精品高清不卡| 久久精品国产在热久久| 麻豆精品一区二区| 黑人精品欧美一区二区蜜桃 | 亚洲欧洲99久久| 国产精品色婷婷久久58| 国产精品久久久久婷婷| 亚洲丝袜制服诱惑| 亚洲美女精品一区| 亚洲大型综合色站| 精品夜夜嗨av一区二区三区| 国产精品中文有码| 国产精品996| 欧美在线观看一二区| 欧美欧美午夜aⅴ在线观看| 欧美一级欧美三级| 国产欧美一区二区三区在线看蜜臀 | 国产一区二区三区四区在线观看| 国模一区二区三区白浆| www.亚洲精品| 欧美三级三级三级爽爽爽| 欧美zozozo| 亚洲天堂免费看| 日韩精品国产欧美| 不卡大黄网站免费看| 欧美日韩视频在线观看一区二区三区| 3d成人动漫网站| 国产精品免费久久久久| 亚洲国产三级在线| 久久99精品视频| 欧美影视一区在线| 久久久久久久久99精品| 亚洲激情中文1区| 久久99精品久久久| 欧美网站大全在线观看| 国产欧美一区二区精品仙草咪| 亚洲夂夂婷婷色拍ww47 | 久久综合久久综合亚洲|