protected void tightMarshalCachedObject2( OpenWireFormat wireFormat, DataStructure o, DataOutput dataOut, BooleanStream bs) throws IOException { if (wireFormat.isCacheEnabled()) { Short index = wireFormat.getMarshallCacheIndex(o); if (bs.readBoolean()) { dataOut.writeShort(index.shortValue()); wireFormat.tightMarshalNestedObject2(o, dataOut, bs); } else { dataOut.writeShort(index.shortValue()); } } else { wireFormat.tightMarshalNestedObject2(o, dataOut, bs); } }
protected void looseMarshalCachedObject( OpenWireFormat wireFormat, DataStructure o, DataOutput dataOut) throws IOException { if (wireFormat.isCacheEnabled()) { Short index = wireFormat.getMarshallCacheIndex(o); dataOut.writeBoolean(index == null); if (index == null) { index = wireFormat.addToMarshallCache(o); dataOut.writeShort(index.shortValue()); wireFormat.looseMarshalNestedObject(o, dataOut); } else { dataOut.writeShort(index.shortValue()); } } else { wireFormat.looseMarshalNestedObject(o, dataOut); } }
protected int tightMarshalCachedObject1( OpenWireFormat wireFormat, DataStructure o, BooleanStream bs) throws IOException { if (wireFormat.isCacheEnabled()) { Short index = wireFormat.getMarshallCacheIndex(o); bs.writeBoolean(index == null); if (index == null) { int rc = wireFormat.tightMarshalNestedObject1(o, bs); wireFormat.addToMarshallCache(o); return 2 + rc; } else { return 2; } } else { return wireFormat.tightMarshalNestedObject1(o, bs); } }