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

ReadInt32() public method

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

Usage Example

 public void TestClearBody()
 {
     ActiveMQBytesMessage bytesMessage = new ActiveMQBytesMessage();
     try {
         bytesMessage.WriteInt32(1);
         bytesMessage.ClearBody();
         Assert.IsFalse(bytesMessage.ReadOnlyBody);
         bytesMessage.WriteInt32(1);
         bytesMessage.ReadInt32();
     }
     catch(MessageNotReadableException)
     {
     }
     catch(MessageNotWriteableException)
     {
         Assert.IsTrue(false);
     }
 }
All Usage Examples Of Apache.NMS.ActiveMQ.Commands.ActiveMQBytesMessage::ReadInt32