Reset() public method

public Reset ( ) : void
return void
	    public void TestReadBoolean() 
		{
	        ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
            msg.WriteBoolean(true);
            msg.Reset();
            Assert.IsTrue(msg.ReadBoolean());
	    }
	    public void TestReadByte()
		{
	        ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
            msg.WriteByte( (byte)2 );
            msg.Reset();
            Assert.IsTrue( msg.ReadByte() == 2 );
	    }
	    public void TestGetBodyLength() 
		{
	        ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
	        int len = 10;

            for(int i = 0; i < len; i++)
			{
                msg.WriteInt64(5L);
            }

            msg.Reset();
            Assert.IsTrue(msg.BodyLength == (len * 8));
	    }
		public void TestCommand()
		{
			ActiveMQBytesMessage message = new ActiveMQBytesMessage();
			
			// Test that a BytesMessage is created in WriteOnly mode.
			try
			{
				byte[] content = message.Content;
				content.SetValue(0, 0);
				Assert.Fail("Should have thrown an exception");
			}
			catch
			{
			}
			
			Assert.IsTrue( !message.ReadOnlyBody );
			Assert.IsTrue( !message.ReadOnlyProperties );
			
			message.Reset();
			
			Assert.IsNull( message.Content );
			Assert.IsTrue( message.ReadOnlyBody );
		}
	    public void TestReadChar() {
	        ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
            msg.WriteChar('a');
            msg.Reset();
            Assert.IsTrue(msg.ReadChar() == 'a');
	    }
	    public void TestReadShort() {
	        ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
            msg.WriteInt16((short) 3000);
            msg.Reset();
            Assert.IsTrue(msg.ReadInt16() == 3000);
	    }
	    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)
			{
	        }
	    }
	    public void TestReadOnlyBody()
		{
	        ActiveMQBytesMessage message = new ActiveMQBytesMessage();
	        try {
	            message.WriteBoolean(true);
	            message.WriteByte((byte) 1);
	            message.WriteBytes(new byte[1]);
	            message.WriteBytes(new byte[3], 0, 2);
	            message.WriteChar('a');
	            message.WriteDouble(1.5);
	            message.WriteSingle((float) 1.5);
	            message.WriteInt32(1);
	            message.WriteInt64(1);
	            message.WriteObject("stringobj");
	            message.WriteInt16((short) 1);
	            message.WriteString("utfstring");
	        }
			catch(MessageNotWriteableException)
			{
	            Assert.Fail("Should be writeable");
	        }
			
	        message.Reset();
	        
			try
			{
	            message.ReadBoolean();
	            message.ReadByte();
	            message.ReadBytes(new byte[1]);
	            message.ReadBytes(new byte[2], 2);
	            message.ReadChar();
	            message.ReadDouble();
	            message.ReadSingle();
	            message.ReadInt32();
	            message.ReadInt64();
	            message.ReadString();
	            message.ReadInt16();
	            message.ReadString();
	        } 
			catch(MessageNotReadableException) 
			{
	            Assert.Fail("Should be readable");
	        }
			
	        try 
			{
	            message.WriteBoolean(true);
	            Assert.Fail("Should have thrown exception");
	        } 
			catch(MessageNotWriteableException) 
			{
	        }
			
	        try
			{
	            message.WriteByte((byte) 1);
	            Assert.Fail("Should have thrown exception");
	        } 
			catch(MessageNotWriteableException) 
			{
	        }
			
	        try
			{
	            message.WriteBytes(new byte[1]);
	            Assert.Fail("Should have thrown exception");
	        } 
			catch(MessageNotWriteableException) 
			{
	        }
			
	        try 
			{
	            message.WriteBytes(new byte[3], 0, 2);
	            Assert.Fail("Should have thrown exception");
	        } 
			catch(MessageNotWriteableException) 
			{
	        }
			
	        try 
			{
	            message.WriteChar('a');
	            Assert.Fail("Should have thrown exception");
	        } 
			catch(MessageNotWriteableException) 
			{
	        }
			
	        try 
			{
	            message.WriteDouble(1.5);
	            Assert.Fail("Should have thrown exception");
	        }
			catch(MessageNotWriteableException)
			{
	        }
			
	        try
			{
	            message.WriteSingle((float) 1.5);
	            Assert.Fail("Should have thrown exception");
	        } 
			catch(MessageNotWriteableException)
			{
	        }
			
	        try 
			{
	            message.WriteInt32(1);
	            Assert.Fail("Should have thrown exception");
	        } 
			catch(MessageNotWriteableException) 
			{
	        }
			
	        try 
			{
	            message.WriteInt64(1);
	            Assert.Fail("Should have thrown exception");
	        } 
			catch(MessageNotWriteableException) 
			{
	        }
			
	        try
			{
	            message.WriteObject("stringobj");
	            Assert.Fail("Should have thrown exception");
	        }
			catch(MessageNotWriteableException) 
			{
	        }
			
	        try 
			{
	            message.WriteInt16((short) 1);
	            Assert.Fail("Should have thrown exception");
	        } 
			catch(MessageNotWriteableException)
			{
	        }
			
	        try
			{
	            message.WriteString("utfstring");
	            Assert.Fail("Should have thrown exception");
	        } 
			catch(MessageNotWriteableException)
			{
	        }
	    }
	    public void TestReadBytesbyteArray() 
		{
	        ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
            byte[] data = new byte[50];
            for(int i = 0; i < data.Length; i++) 
			{
                data[i] = (byte) i;
            }
            msg.WriteBytes(data);
            msg.Reset();
            byte[] test = new byte[data.Length];
            msg.ReadBytes(test);
            for(int i = 0; i < test.Length; i++) 
			{
                Assert.IsTrue(test[i] == i);
            }
	    }
	    public void TestReadString() {
	        ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
            string str = "this is a test";
            msg.WriteString(str);
            msg.Reset();
            Assert.IsTrue(msg.ReadString() == str);
	    }
	    public void TestReadDouble() {
	        ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
            msg.WriteDouble(3.3d);
            msg.Reset();
            Assert.IsTrue(msg.ReadDouble() == 3.3d);
	    }
	    public void TestReadFloat() {
	        ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
            msg.WriteSingle(3.3f);
            msg.Reset();
            Assert.IsTrue(msg.ReadSingle() == 3.3f);
	    }
	    public void TestReadLong() {
	        ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
            msg.WriteInt64(3000);
            msg.Reset();
            Assert.IsTrue(msg.ReadInt64() == 3000);
	    }