summaryrefslogtreecommitdiff
path: root/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java')
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java45
1 files changed, 27 insertions, 18 deletions
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java
index 8a2ad53157..f6fa89a91c 100644
--- a/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java
+++ b/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java
@@ -20,24 +20,23 @@
*/
package org.apache.qpid.framing;
+import org.apache.qpid.AMQException;
+import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
+
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
-import org.apache.qpid.AMQException;
-
public class ContentHeaderBody implements AMQBody
{
public static final byte TYPE = 2;
- public int classId;
+ private int classId;
- public int weight;
+ private int weight;
- /** unsigned long but java can't handle that anyway when allocating byte array */
- public long bodySize;
+ private long bodySize;
/** must never be null */
private ContentHeaderProperties properties;
@@ -76,17 +75,6 @@ public class ContentHeaderBody implements AMQBody
return TYPE;
}
- protected void populateFromBuffer(DataInputStream buffer, long size)
- throws AMQFrameDecodingException, AMQProtocolVersionException, IOException
- {
- classId = buffer.readUnsignedShort();
- weight = buffer.readUnsignedShort();
- bodySize = buffer.readLong();
- int propertyFlags = buffer.readUnsignedShort();
- ContentHeaderPropertiesFactory factory = ContentHeaderPropertiesFactory.getInstance();
- properties = factory.createContentHeaderProperties(classId, propertyFlags, buffer, (int)size - 14);
- }
-
/**
* Helper method that is used currently by the persistence layer (by BDB at the moment).
* @param buffer
@@ -153,4 +141,25 @@ public class ContentHeaderBody implements AMQBody
", properties=" + properties +
'}';
}
+
+ public int getClassId()
+ {
+ return classId;
+ }
+
+ public int getWeight()
+ {
+ return weight;
+ }
+
+ /** unsigned long but java can't handle that anyway when allocating byte array */
+ public long getBodySize()
+ {
+ return bodySize;
+ }
+
+ public void setBodySize(long bodySize)
+ {
+ this.bodySize = bodySize;
+ }
}