summaryrefslogtreecommitdiff
path: root/qpid/java/client/src/main
diff options
context:
space:
mode:
authorRobert Greig <rgreig@apache.org>2006-12-13 11:01:09 +0000
committerRobert Greig <rgreig@apache.org>2006-12-13 11:01:09 +0000
commit8b118d220e0248541efe26e8fe2d7fc0cf640dee (patch)
tree95f5f0e4e8f4bab5287533acbe02a6dffa2f5845 /qpid/java/client/src/main
parentb7ec18a17ffc4fac200fcbca67776aa9615ad5b4 (diff)
downloadqpid-python-8b118d220e0248541efe26e8fe2d7fc0cf640dee.tar.gz
QPID-175 Patch supplied by Rob Godfrey. Now allocates new autoexpanding buffer for StreamMessage when clearBody is called
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@486594 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/client/src/main')
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java b/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java
index bec0686ce4..6935cde491 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java
@@ -59,11 +59,16 @@ public abstract class AbstractBytesMessage extends AbstractJMSMessage
if (_data == null)
{
- _data = ByteBuffer.allocate(DEFAULT_BUFFER_INITIAL_SIZE);
- _data.setAutoExpand(true);
+ allocateInitialBuffer();
}
}
+ private void allocateInitialBuffer()
+ {
+ _data = ByteBuffer.allocate(DEFAULT_BUFFER_INITIAL_SIZE);
+ _data.setAutoExpand(true);
+ }
+
AbstractBytesMessage(long messageNbr, ContentHeaderBody contentHeader, ByteBuffer data)
throws AMQException
{
@@ -74,7 +79,7 @@ public abstract class AbstractBytesMessage extends AbstractJMSMessage
public void clearBodyImpl() throws JMSException
{
- _data.clear();
+ allocateInitialBuffer();
}
public String toBodyString() throws JMSException