Apache.NMS.ActiveMQ.Commands.ActiveMQBytesMessage.ReadDouble C# (CSharp) Method

ReadDouble() public method

public ReadDouble ( ) : double
return double
        public double ReadDouble()
        {
            InitializeReading();
            try
            {
                return dataIn.ReadDouble();
            }
            catch(EndOfStreamException e)
            {
                throw NMSExceptionSupport.CreateMessageEOFException(e);
            }
            catch(IOException e)
            {
                throw NMSExceptionSupport.CreateMessageFormatException(e);
            }
        }

Usage Example

	    public void TestReset() {

			ActiveMQBytesMessage message = new ActiveMQBytesMessage();
	        
			try 
			{
	            message.WriteDouble(24.5);
	            message.WriteInt64(311);
	        } 
			catch(MessageNotWriteableException)
			{
	            Assert.Fail("should be writeable");
	        }
	        
			message.Reset();
	        
			try {
	            Assert.IsTrue(message.ReadOnlyBody);
	            Assert.AreEqual(message.ReadDouble(), 24.5, 0);
	            Assert.AreEqual(message.ReadInt64(), 311);
	        } 
			catch(MessageNotReadableException) 
			{
	            Assert.Fail("should be readable");
	        }
	        
			try
			{
	            message.WriteInt32(33);
	            Assert.Fail("should throw exception");
	        }
			catch(MessageNotWriteableException)
			{
	        }
	    }
All Usage Examples Of Apache.NMS.ActiveMQ.Commands.ActiveMQBytesMessage::ReadDouble