public void writeExternal(ObjectOutput out) throws IOException { out.writeByte(0); // reserved for future expansion (version id) out.writeShort(fieldNumber); if (header != null) writeHeader(out); if (packager != null) writePackager(out); if (direction > 0) writeDirection(out); // List keySet = new ArrayList (fields.keySet()); // Collections.sort (keySet); Iterator iter = fields.values().iterator(); while (iter.hasNext()) { ISOComponent c = (ISOComponent) iter.next(); if (c instanceof ISOMsg) { writeExternal(out, 'M', c); } else if (c instanceof ISOBinaryField) { writeExternal(out, 'B', c); } else if (c instanceof ISOAmount) { writeExternal(out, 'A', c); } else if (c instanceof ISOField) { writeExternal(out, 'F', c); } } out.writeByte('E'); }
// Implements Externalizable public void writeExternal(ObjectOutput out) throws IOException { // VERSION out.writeByte(0); // MAP out.writeObject(_map); }
protected void writePackager(ObjectOutput out) throws IOException { out.writeByte('P'); String pclass = packager.getClass().getName(); byte[] b = pclass.getBytes(); out.writeShort(b.length); out.write(b); }
public void writeExternal(final ObjectOutput out) throws IOException { out.writeByte(0); out.writeInt(this._size); final SerializationProcedure writeProcedure = new SerializationProcedure(out); if (!this.forEach(writeProcedure)) { throw writeProcedure.exception; } }
protected void writeHeader(ObjectOutput out) throws IOException { int len = header.getLength(); if (len > 0) { out.writeByte('H'); out.writeShort(len); out.write(header.pack()); } }
/** {@inheritDoc} */ public void writeExternal(ObjectOutput out) throws IOException { // VERSION out.writeByte(0); // SUPER super.writeExternal(out); // NUMBER OF ENTRIES out.writeInt(_size); // ENTRIES for (int i = _states.length; i-- > 0; ) { if (_states[i] == FULL) { out.writeByte(_set[i]); out.writeShort(_values[i]); } } }
public void writeExternal(final ObjectOutput out) throws IOException { out.writeByte(1); out.writeInt(this._pos); final int len = this._pos; out.writeInt(this._pos); for (int i = 0; i < len; ++i) { out.writeShort(this._data[i]); } }
/** {@inheritDoc} */ @Override public void writeExternal(ObjectOutput out) throws IOException { // VERSION out.writeByte(0); // SUPER super.writeExternal(out); // NUMBER OF ENTRIES out.writeInt(_size); // ENTRIES for (int i = capacity(); i-- > 0; ) { if (_states.get(i) == FULL) { out.writeChar(_set.get(i)); out.writeChar(_values.get(i)); } } }
private void writeExternal(ObjectOutput out, char b, ISOComponent c) throws IOException { out.writeByte(b); ((Externalizable) c).writeExternal(out); }
protected void writeDirection(ObjectOutput out) throws IOException { out.writeByte('D'); out.writeByte(direction); }