亚洲欧美第一页_禁久久精品乱码_粉嫩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网址在线观看| 日韩欧美二区三区| 午夜精品视频一区| 色天天综合色天天久久| 国产亚洲欧美激情| 久久se精品一区精品二区| 欧美日韩精品一区二区三区蜜桃| 国产欧美日韩精品一区| 久久成人精品无人区| 欧美在线三级电影| 亚洲免费观看高清| 91日韩在线专区| 中文字幕一区二区三区蜜月| 国产综合色精品一区二区三区| 欧美日韩精品高清| 亚洲国产一区二区a毛片| 91日韩精品一区| 国产精品国产三级国产普通话99 | 麻豆国产欧美日韩综合精品二区| 91猫先生在线| 亚洲欧美经典视频| 日本韩国欧美在线| 亚洲人成精品久久久久久| 国v精品久久久网| 2017欧美狠狠色| 韩日精品视频一区| 欧美精品一区二区在线播放| 另类小说综合欧美亚洲| 日韩一区二区精品| 精品系列免费在线观看| 精品国产一区二区三区av性色| 午夜视频一区二区| 欧美一卡二卡三卡四卡| 久久精品久久99精品久久| 久久一区二区三区国产精品| 国产成人在线免费观看| 久久色在线视频| 国产 日韩 欧美大片| 亚洲国产电影在线观看| av在线这里只有精品| 亚洲欧美自拍偷拍色图| 91黄视频在线观看| 无码av中文一区二区三区桃花岛| 欧美放荡的少妇| 免费在线成人网| 国产欧美精品日韩区二区麻豆天美| 激情欧美一区二区| 中文字幕乱码日本亚洲一区二区| 99re视频精品| 亚洲国产精品一区二区www| 日韩一区二区免费视频| 黑人巨大精品欧美一区| 国产欧美日韩卡一| 色噜噜狠狠成人网p站| 日韩国产欧美三级| 国产欧美一区二区精品久导航| 成人一区在线看| 亚洲精选在线视频| 欧美一区二区在线播放| 国产精品1区二区.| 亚洲男人的天堂在线aⅴ视频| 欧美精品高清视频| 国产成人综合亚洲网站| 亚洲国产精品久久不卡毛片| 欧美第一区第二区| 一本色道a无线码一区v| 免费视频最近日韩| 亚洲欧美日韩国产综合| 日韩一级完整毛片| 色老综合老女人久久久| 久久福利视频一区二区| 亚洲精品免费在线| 久久女同互慰一区二区三区| 在线精品国精品国产尤物884a| 久久精品国产**网站演员| 亚洲欧美色综合| 国产亚洲一区二区三区四区| 欧美老肥妇做.爰bbww| 丁香激情综合国产| 免费的成人av| 亚洲另类在线一区| 欧美激情一区二区三区蜜桃视频| 日本电影欧美片| 国产成人精品在线看| 日韩av中文字幕一区二区| 自拍偷在线精品自拍偷无码专区 | 国产精品456露脸| 午夜a成v人精品| 亚洲男帅同性gay1069| 中文字幕精品三区| 2024国产精品| 日韩一区二区精品在线观看| 欧美午夜精品一区二区蜜桃| 99精品久久99久久久久| 大白屁股一区二区视频| 精品无人码麻豆乱码1区2区| 天堂一区二区在线| 亚洲国产一区二区在线播放| 亚洲柠檬福利资源导航| 国产精品国产三级国产aⅴ无密码| 日韩精品一区二区三区视频播放| 欧美日韩精品综合在线| 欧美日韩视频在线第一区| 99久久精品国产观看| 国产sm精品调教视频网站| 国产一区视频在线看| 极品美女销魂一区二区三区免费| 久久精品国产亚洲一区二区三区| 免费视频最近日韩| 日本在线不卡视频一二三区| 婷婷综合另类小说色区| 午夜精品免费在线| 欧美aⅴ一区二区三区视频| 天天色图综合网| 蜜桃久久av一区| 韩国午夜理伦三级不卡影院| 狠狠色狠狠色合久久伊人| 国产一区二区三区视频在线播放 | 天天综合天天综合色| 日韩电影免费在线| 另类中文字幕网| 国产精品18久久久久久久网站| 国产精品自产自拍| 顶级嫩模精品视频在线看| 成人毛片视频在线观看| 91麻豆视频网站| 欧美精品vⅰdeose4hd| 91精品久久久久久久99蜜桃| 欧美成人免费网站| 亚洲国产激情av| 亚洲精品视频免费观看| 午夜精品久久久久久久久| 美女国产一区二区| 国产精一区二区三区| 色一区在线观看| 337p亚洲精品色噜噜| 久久久久国产精品麻豆ai换脸 | 久久综合av免费| 亚洲六月丁香色婷婷综合久久 | 精品一区二区三区香蕉蜜桃| 国产精品99久久久| 欧美在线不卡视频| 欧美成人精品二区三区99精品| 国产免费观看久久| 亚洲一区二区三区四区在线观看| 美日韩一区二区三区| 国产91在线看| 欧美日韩另类一区| 国产婷婷一区二区| 亚洲一卡二卡三卡四卡五卡| 毛片av一区二区| 91色乱码一区二区三区| 日韩欧美另类在线| 亚洲女人****多毛耸耸8| 美女被吸乳得到大胸91| 97久久精品人人做人人爽| 日韩网站在线看片你懂的| 日韩一区欧美小说| 激情都市一区二区| 在线免费观看日韩欧美| 国产日本一区二区| 日韩影视精彩在线| 色综合网色综合| 久久久www成人免费无遮挡大片| 亚洲国产日产av| 91亚洲精品久久久蜜桃网站 | 久久影音资源网| 亚洲图片欧美色图| 成人性生交大片| 91精品国产欧美一区二区18 | 久久综合色之久久综合| 亚洲日韩欧美一区二区在线| 美国十次综合导航| 色一区在线观看| 中文字幕久久午夜不卡| 久久99国产乱子伦精品免费| 在线播放中文一区| 亚洲激情在线激情| 色综合久久综合| 亚洲天堂精品视频| fc2成人免费人成在线观看播放| 日韩欧美国产一区二区三区| 亚洲成人午夜电影| 欧美性猛交xxxx黑人交| 一区二区三区资源| 99久久精品免费看国产| 国产精品欧美久久久久一区二区| 激情小说欧美图片| 日韩美一区二区三区| 日韩av网站在线观看| 欧美精品在线观看一区二区| 一区二区三区免费在线观看| 一本大道久久a久久综合| 亚洲欧美国产三级| 色婷婷亚洲综合|