Author: rhs
Date: Wed Jan 24 11:52:03 2007
New Revision: 499550
URL: http://svn.apache.org/viewvc?view=rev&rev=499550
Log:
Content.writePayload now handles a null byte buffer
Modified:
incubator/qpid/branches/qpid.0-9/java/common/src/main/java/org/apache/qpid/framing/Content.java
Modified:
incubator/qpid/branches/qpid.0-9/java/common/src/main/java/org/apache/qpid/framing/Content.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/common/src/main/java/org/apache/qpid/framing/Content.java?view=diff&rev=499550&r1=499549&r2=499550
==============================================================================
---
incubator/qpid/branches/qpid.0-9/java/common/src/main/java/org/apache/qpid/framing/Content.java
(original)
+++
incubator/qpid/branches/qpid.0-9/java/common/src/main/java/org/apache/qpid/framing/Content.java
Wed Jan 24 11:52:03 2007
@@ -125,8 +125,12 @@
public void writePayload(ByteBuffer buffer)
{
EncodingUtils.writeUnsignedByte(buffer, contentType.toByte());
- EncodingUtils.writeUnsignedInteger(buffer, content.remaining());
- buffer.put(content.duplicate());
+ if (content == null) {
+ EncodingUtils.writeUnsignedInteger(buffer, 0);
+ } else {
+ EncodingUtils.writeUnsignedInteger(buffer, content.remaining());
+ buffer.put(content.duplicate());
+ }
}
public void populateFromBuffer(ByteBuffer buffer) throws
AMQFrameDecodingException