summaryrefslogtreecommitdiff
path: root/java/common/src
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2009-12-17 17:22:41 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2009-12-17 17:22:41 +0000
commit39892fdf3e08ee346a796f1a87c7379850ce6100 (patch)
treee392a9e31ec298ae85ea7f004e637954a4b7a61a /java/common/src
parenteee5d5205678d42fa0779dee549baac4231eb8a9 (diff)
downloadqpid-python-39892fdf3e08ee346a796f1a87c7379850ce6100.tar.gz
This is a fix for QPID-1830
I have removed the checkReadable() method from the toBodyString() This will enable the toString() method to be used any time on message. I have also modified the Functions.str() to take in an additional parameter to denote to the starting position of the buffer. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@891805 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common/src')
-rw-r--r--java/common/src/main/java/org/apache/qpid/transport/util/Functions.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/java/common/src/main/java/org/apache/qpid/transport/util/Functions.java b/java/common/src/main/java/org/apache/qpid/transport/util/Functions.java
index c220694b50..9f1c0ca9eb 100644
--- a/java/common/src/main/java/org/apache/qpid/transport/util/Functions.java
+++ b/java/common/src/main/java/org/apache/qpid/transport/util/Functions.java
@@ -57,12 +57,17 @@ public class Functions
public static final String str(ByteBuffer buf, int limit)
{
+ return str(buf, limit,buf.position());
+ }
+
+ public static final String str(ByteBuffer buf, int limit,int start)
+ {
StringBuilder str = new StringBuilder();
str.append('"');
for (int i = 0; i < min(buf.remaining(), limit); i++)
{
- byte c = buf.get(buf.position() + i);
+ byte c = buf.get(start + i);
if (c > 31 && c < 127 && c != '\\')
{