Apache.NMS.ActiveMQ.Commands.ActiveMQStreamMessage.Reset C# (CSharp) Method

Reset() public method

public Reset ( ) : void
return void
        public void Reset()
        {
            StoreContent();
            this.dataIn = null;
            this.dataOut = null;
            this.byteBuffer = null;
            this.bytesRemaining = -1;
            this.ReadOnlyBody = true;
        }

Usage Example

        public void TestReadBigString()
        {
            ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
            // Test with a 1Meg String
            StringBuilder bigSB = new StringBuilder(1024 * 1024);
            for(int i = 0; i < 1024 * 1024; i++)
            {
                bigSB.Append((char)'a' + i % 26);
            }
            String bigString = bigSB.ToString();

            msg.WriteString(bigString);
            msg.Reset();
            Assert.AreEqual(bigString, msg.ReadString());
        }
All Usage Examples Of Apache.NMS.ActiveMQ.Commands.ActiveMQStreamMessage::Reset