/** * Writes `repository_id' to this stream, perhaps via indirection. */ private void write_repository_id(final String repository_id) { Integer _index = getRepIdMap().get (repository_id); if ( _index == null) { // a new repository id -- write it // first make sure the pos we're about to remember is // a correctly aligned one, i.e., the actual writing position int remainder = 4 - (index % 4); if ( remainder != 4 ) { index += remainder; pos += remainder; } getRepIdMap().put (repository_id, Integer.valueOf(size())); write_string (repository_id); } else { // a previously written repository id -- make an indirection write_long (0xffffffff); write_long (_index.intValue() - size()); } }
/** * 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; }
@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(); } }
(8 - ((Messages.MSG_HEADER_SIZE + ctx_out.size ()) % 8)); difference = (difference == 8)? 0 : difference; - Messages.MSG_HEADER_SIZE - 4 + ctx_out.size() ); ctx_out.write( conn, 0, ctx_out.size() ); int new_header_end = getHeaderEnd() - 4 + ctx_out.size(); - 4 - getHeaderPadding() + ctx_out.size() ); ctx_out.write( conn, 0, ctx_out.size());