nevado-jms/src/main/java/org/skyscreamer/nevado/jms/message/NevadoStreamMessage.java
/**
     * Reads a 64-bit integer from the stream message.
     *
     * @return a 64-bit integer value from the stream message, interpreted as a
     *         <code>long</code>
     * @throws JMSException
     *             if the JMS provider fails to read the message due to some
     *             internal error.
     * @throws MessageEOFException
     *             if unexpected end of message stream has been reached.
     * @throws MessageFormatException
     *             if this type conversion is invalid.
     * @throws MessageNotReadableException
     *             if the message is in write-only mode.
     */
Reads a 64-bit integer from the stream message.
@return a 64-bit integer value from the stream message, interpreted as a
long
@throws JMSException
if the JMS provider fails to read the message due to some
internal error.
@throws MessageEOFException
if unexpected end of message stream has been reached.
@throws MessageFormatException
if this type conversion is invalid.
@throws MessageNotReadableException
if the message is in write-only mode.
Reads a 64 - bit integer from the stream message . @return a 64 - bit integer value from the stream message interpreted as a long @throws JMSException if the JMS provider fails to read the message due to some internal error . @throws MessageEOFException if unexpected end of message stream has been reached . @throws MessageFormatException if this type conversion is invalid . @throws MessageNotReadableException if the message is in write - only mode .
public long readLong() throws JMSException {
        initializeReading();
        try {
            this.dataIn.mark(65);
            int type = this.dataIn.read();
            if (type == -1) {
                throw new MessageEOFException("reached end of data");
            }
            if (type == MarshallingSupport.LONG_TYPE) {
                return this.dataIn.readLong();
            }
            if (type == MarshallingSupport.INTEGER_TYPE) {
                return this.dataIn.readInt();
            }
            if (type == MarshallingSupport.SHORT_TYPE) {
                return this.dataIn.readShort();
            }
            if (type == MarshallingSupport.BYTE_TYPE) {
                return this.dataIn.readByte();
            }
            if (type == MarshallingSupport.STRING_TYPE) {
                return Long.valueOf(this.dataIn.readUTF()).longValue();
            }
            if (type == MarshallingSupport.NULL) {
                this.dataIn.reset();
                throw new NullPointerException("Cannot convert NULL value to long.");
            } else {
                this.dataIn.reset();
                throw new MessageFormatException(" not a long type");
            }
        } catch (NumberFormatException mfe) {
            try {
                this.dataIn.reset();
            } catch (IOException ioe) {
                JMSException jmsEx = new MessageFormatException(ioe.getMessage());
                jmsEx.setLinkedException(ioe);
                throw jmsEx;
            }
            throw mfe;
        } catch (EOFException e) {
            String exMessage = "Reached premature EOF: " + e.getMessage();
            _log.error(exMessage, e);
            throw new JMSException(exMessage);
        } catch (IOException e) {
            String exMessage = "Could not read boolean: " + e.getMessage();
            _log.error(exMessage, e);
            throw new JMSException(exMessage);
        }
    }
public long readLong ( ) throws JMSException { initializeReading ( ) ; try { this . dataIn . mark ( 65 ) ; int type = this . dataIn . read ( ) ; if ( type == - 1 ) { throw new MessageEOFException ( "reached end of data" ) ; } if ( type == MarshallingSupport . LONG_TYPE ) { return this . dataIn . readLong ( ) ; } if ( type == MarshallingSupport . INTEGER_TYPE ) { return this . dataIn . readInt ( ) ; } if ( type == MarshallingSupport . SHORT_TYPE ) { return this . dataIn . readShort ( ) ; } if ( type == MarshallingSupport . BYTE_TYPE ) { return this . dataIn . readByte ( ) ; } if ( type == MarshallingSupport . STRING_TYPE ) { return Long . valueOf ( this . dataIn . readUTF ( ) ) . longValue ( ) ; } if ( type == MarshallingSupport . NULL ) { this . dataIn . reset ( ) ; throw new NullPointerException ( "Cannot convert NULL value to long." ) ; } else { this . dataIn . reset ( ) ; throw new MessageFormatException ( " not a long type" ) ; } } catch ( NumberFormatException mfe ) { try { this . dataIn . reset ( ) ; } catch ( IOException ioe ) { JMSException jmsEx = new MessageFormatException ( ioe . getMessage ( ) ) ; jmsEx . setLinkedException ( ioe ) ; throw jmsEx ; } throw mfe ; } catch ( EOFException e ) { String exMessage = "Reached premature EOF: " + e . getMessage ( ) ; _log . error ( exMessage , e ) ; throw new JMSException ( exMessage ) ; } catch ( IOException e ) { String exMessage = "Could not read boolean: " + e . getMessage ( ) ; _log . error ( exMessage , e ) ; throw new JMSException ( exMessage ) ; } }
Reads a 64-bit integer from the stream message.
Reads a 64 - bit integer from the stream message .