コード例 #1
0
  /** {@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]);
      }
    }
  }
コード例 #2
0
  /** {@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));
      }
    }
  }