/** * If `value' is null, or has already been written to this stream, * then this method writes that information to the stream and returns * true, otherwise does nothing and returns false. */ private boolean write_special_value(final java.io.Serializable value) { if (value == null) { // null tag write_long (0x00000000); return true; } Integer index = getValueMap().get (value); if (index != null) { // value has already been written -- make an indirection write_long (0xffffffff); write_long (index.intValue() - size()); return true; } return false; }
getValueMap(), getRepIdMap(), getCodebaseMap())
@Override public void write_value(final java.io.Serializable value, final org.omg.CORBA.portable.BoxedValueHelper factory) { if (!write_special_value (value)) { write_previous_chunk_size(); check(7,4); getValueMap().put (value, Integer.valueOf(size())); if (((value instanceof org.omg.CORBA.portable.IDLEntity) || isSimpleString(value, factory))) { write_long (0x7fffff00 | chunkingFlag); } else { // repository id is required for RMI: types write_long (0x7fffff02 | chunkingFlag); final String repId = factory.get_id(); write_repository_id (repId); } start_chunk(); factory.write_value (this, value); end_chunk(); } }
getValueMap().put(value, Integer.valueOf(size())); Integer index = getValueMap().get(newValue); if (index != null)