nevado-jms/src/main/java/org/skyscreamer/nevado/jms/message/NevadoStreamMessage.java
/**
     * Reads a <code>boolean</code> from the stream message.
     *
     * @return the <code>boolean</code> value read
     * @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 javax.jms.MessageNotReadableException
     *             if the message is in write-only mode.
     */
Reads a boolean from the stream message.
@return the boolean value read
@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 javax.jms.MessageNotReadableException
if the message is in write-only mode.
Reads a boolean from the stream message . @return the boolean value read @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 javax . jms . MessageNotReadableException if the message is in write - only mode .
public boolean readBoolean() throws JMSException {
        initializeReading();
        try {
            this.dataIn.mark(10);
            int type = this.dataIn.read();
            if (type == -1) {
                throw new MessageEOFException("reached end of data");
            }
            if (type == MarshallingSupport.BOOLEAN_TYPE) {
                return this.dataIn.readBoolean();
            }
            if (type == MarshallingSupport.STRING_TYPE) {
                return Boolean.valueOf(this.dataIn.readUTF()).booleanValue();
            }
            if (type == MarshallingSupport.NULL) {
                this.dataIn.reset();
                throw new NullPointerException("Cannot convert NULL value to boolean.");
            } else {
                this.dataIn.reset();
                throw new MessageFormatException(" not a boolean type");
            }
        } 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 boolean readBoolean ( ) throws JMSException { initializeReading ( ) ; try { this . dataIn . mark ( 10 ) ; int type = this . dataIn . read ( ) ; if ( type == - 1 ) { throw new MessageEOFException ( "reached end of data" ) ; } if ( type == MarshallingSupport . BOOLEAN_TYPE ) { return this . dataIn . readBoolean ( ) ; } if ( type == MarshallingSupport . STRING_TYPE ) { return Boolean . valueOf ( this . dataIn . readUTF ( ) ) . booleanValue ( ) ; } if ( type == MarshallingSupport . NULL ) { this . dataIn . reset ( ) ; throw new NullPointerException ( "Cannot convert NULL value to boolean." ) ; } else { this . dataIn . reset ( ) ; throw new MessageFormatException ( " not a boolean type" ) ; } } 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 <code>boolean</code> from the stream message.
Reads a <code > boolean< / code > from the stream message .