Author: rhs
Date: Tue Sep  4 10:40:36 2007
New Revision: 572750

URL: http://svn.apache.org/viewvc?rev=572750&view=rev
Log:
added debugging utility method

Modified:
    
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java

Modified: 
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java?rev=572750&r1=572749&r2=572750&view=diff
==============================================================================
--- 
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java
 (original)
+++ 
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java
 Tue Sep  4 10:40:36 2007
@@ -1092,4 +1092,17 @@
             return rejected;
         }
     }
+
+    public String getBodyAsString()
+    {
+        StringBuilder b = new StringBuilder();
+        for (Iterator<ContentChunk> it = getContentBodyIterator(); 
it.hasNext(); )
+        {
+            ByteBuffer buf = it.next().getData();
+            byte[] bytes = new byte[buf.remaining()];
+            buf.duplicate().get(bytes);
+            b.append(new String(bytes));
+        }
+        return b.toString();
+    }
 }


Reply via email to