summaryrefslogtreecommitdiff
path: root/java/common/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/common/src')
-rw-r--r--java/common/src/main/java/org/apache/qpidity/transport/Struct.java74
1 files changed, 2 insertions, 72 deletions
diff --git a/java/common/src/main/java/org/apache/qpidity/transport/Struct.java b/java/common/src/main/java/org/apache/qpidity/transport/Struct.java
index f901f9e840..9146f41535 100644
--- a/java/common/src/main/java/org/apache/qpidity/transport/Struct.java
+++ b/java/common/src/main/java/org/apache/qpidity/transport/Struct.java
@@ -108,79 +108,9 @@ public abstract class Struct implements Encodable
return getFlagCount() - getFields().size();
}
- public final void read(Decoder dec)
- {
- List<Field<?,?>> fields = getFields();
-
- assert fields.size() <= getFlagCount();
-
- if (packed())
- {
- for (Field<?,?> f : fields)
- {
- if (isBit(f))
- {
- f.has(this, true);
- f.read(dec, this);
- }
- else
- {
- f.has(this, dec.readBit());
- }
- }
-
- for (int i = 0; i < getReservedFlagCount(); i++)
- {
- if (dec.readBit())
- {
- throw new IllegalStateException("reserved flag true");
- }
- }
- }
-
- for (Field<?,?> f : fields)
- {
- if (encoded(f))
- {
- f.read(dec, this);
- }
- }
- }
-
- public final void write(Encoder enc)
- {
- List<Field<?,?>> fields = getFields();
+ public abstract void read(Decoder dec);
- assert fields.size() <= getFlagCount();
-
- if (packed())
- {
- for (Field<?,?> f : fields)
- {
- if (isBit(f))
- {
- f.write(enc, this);
- }
- else
- {
- enc.writeBit(f.has(this));
- }
- }
-
- for (int i = 0; i < getReservedFlagCount(); i++)
- {
- enc.writeBit(false);
- }
- }
-
- for (Field<?,?> f : fields)
- {
- if (encoded(f))
- {
- f.write(enc, this);
- }
- }
- }
+ public abstract void write(Encoder enc);
public String toString()
{