2009-08-31 Michael Barker <mike@middlesoft.co.uk>
[mono.git] / mcs / class / RabbitMQ.Client / src / client / content / BasicMessageReader.cs
index 0874f28f506a0fb7a1c0fc57dbc7910971a4cc49..474961948348f865973da9be03c9bce1026e2df7 100644 (file)
@@ -61,14 +61,16 @@ using System.Collections;
 using RabbitMQ.Client;
 using RabbitMQ.Util;
 
-namespace RabbitMQ.Client.Content {
+namespace RabbitMQ.Client.Content
+{
     ///<summary>Framework for analyzing various types of AMQP
     ///Basic-class application messages.</summary>
-    public class BasicMessageReader: IMessageReader {
+    public class BasicMessageReader : IMessageReader
+    {
         protected IBasicProperties m_properties;
         protected byte[] m_body;
 
-       protected MemoryStream m_stream = null;
+        protected MemoryStream m_stream = null;
         protected NetworkBinaryReader m_reader = null;
 
         ///<summary>Retrieve this instance's NetworkBinaryReader reading from BodyBytes.</summary>
@@ -78,9 +80,12 @@ namespace RabbitMQ.Client.Content {
         /// exists, the existing instance is returned. The instance is
         /// not reset.
         ///</remarks>
-        public NetworkBinaryReader Reader {
-            get {
-                if (m_reader == null) {
+        public NetworkBinaryReader Reader
+        {
+            get
+            {
+                if (m_reader == null)
+                {
                     m_reader = new NetworkBinaryReader(BodyStream);
                 }
                 return m_reader;
@@ -88,53 +93,66 @@ namespace RabbitMQ.Client.Content {
         }
 
         ///<summary>Construct an instance ready for reading.</summary>
-        public BasicMessageReader(IBasicProperties properties, byte[] body) {
+        public BasicMessageReader(IBasicProperties properties, byte[] body)
+        {
             m_properties = properties;
             m_body = body;
         }
 
-       ///<summary>Implement IMessageReader.Headers</summary>
-       public IDictionary Headers {
-           get {
-               if (Properties.Headers == null) {
-                   Properties.Headers = new Hashtable();
-               }
-               return Properties.Headers;
-           }
-       }
+        ///<summary>Implement IMessageReader.Headers</summary>
+        public IDictionary Headers
+        {
+            get
+            {
+                if (Properties.Headers == null)
+                {
+                    Properties.Headers = new Hashtable();
+                }
+                return Properties.Headers;
+            }
+        }
 
         ///<summary>Retrieve the IBasicProperties associated with this instance.</summary>
-        public IBasicProperties Properties {
-           get {
-               return m_properties;
-           }
-       }
+        public IBasicProperties Properties
+        {
+            get
+            {
+                return m_properties;
+            }
+        }
 
-       ///<summary>Implement IMessageReader.BodyBytes</summary>
-        public byte[] BodyBytes {
-            get {
+        ///<summary>Implement IMessageReader.BodyBytes</summary>
+        public byte[] BodyBytes
+        {
+            get
+            {
                 return m_body;
             }
         }
 
-       ///<summary>Implement IMessageReader.BodyStream</summary>
-       public Stream BodyStream {
-           get {
-               if (m_stream == null) {
-                   m_stream = new MemoryStream(m_body);
-               }
-               return m_stream;
-           }
-       }
+        ///<summary>Implement IMessageReader.BodyStream</summary>
+        public Stream BodyStream
+        {
+            get
+            {
+                if (m_stream == null)
+                {
+                    m_stream = new MemoryStream(m_body);
+                }
+                return m_stream;
+            }
+        }
 
-       ///<summary>Implement IMessageReader.RawRead</summary>
-       public int RawRead() {
-           return BodyStream.ReadByte();
-       }
+        ///<summary>Implement IMessageReader.RawRead</summary>
+        public int RawRead()
+        {
+            return BodyStream.ReadByte();
+        }
 
-       ///<summary>Implement IMessageReader.RawRead</summary>
-       public int RawRead(byte[] target, int offset, int length) {
-           return BodyStream.Read(target, offset, length);
-       }
+        ///<summary>Implement IMessageReader.RawRead</summary>
+        public int RawRead(byte[] target, int offset, int length)
+        {
+            return BodyStream.Read(target, offset, length);
+        }
     }
 }