예제 #1
0
  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);
  }
예제 #3
0
 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);
 }
예제 #4
0
 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;
   }
 }
예제 #5
0
 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));
      }
    }
  }
예제 #9
0
 private void writeExternal(ObjectOutput out, char b, ISOComponent c) throws IOException {
   out.writeByte(b);
   ((Externalizable) c).writeExternal(out);
 }
예제 #10
0
 protected void writeDirection(ObjectOutput out) throws IOException {
   out.writeByte('D');
   out.writeByte(direction);
 }