Example #1
0
  public void writeExternal(ObjectOutput out) throws IOException {
    // VERSION
    out.writeByte(0);

    // LOAD FACTOR
    out.writeFloat(_loadFactor);

    // AUTO COMPACTION LOAD FACTOR
    out.writeFloat(_autoCompactionFactor);
  }
Example #2
0
 @Override
 public void writeExternal(ObjectOutput output) throws IOException {
   output.writeObject(baseTower);
   output.writeObject(race);
   output.writeFloat(health);
   output.writeFloat(cooldown);
   output.writeFloat(x);
   output.writeFloat(y);
   output.writeFloat(z);
   output.writeInt(id);
   output.writeBoolean(building);
   output.writeObject(target);
 }
  /** {@inheritDoc} */
  public void writeExternal(ObjectOutput out) throws IOException {
    // VERSION
    out.writeByte(0);

    // NO_ENTRY_VALUE
    out.writeFloat(no_entry_value);

    // ENTRIES
    out.writeInt(size);
    for (TFloatIterator iterator = iterator(); iterator.hasNext(); ) {
      float next = iterator.next();
      out.writeFloat(next);
    }
  }
Example #4
0
  private void writeTo(ObjectOutput o) throws IOException {
    o.writeInt(x);
    o.writeInt(y);
    o.writeInt(width);
    o.writeInt(height);
    o.writeInt(measuredWidth);
    o.writeInt(measuredHeight);
    o.writeInt(scrollX);
    o.writeInt(scrollY);
    o.writeInt(absoluteX);
    o.writeInt(absoluteY);
    o.writeFloat(cameraDistance);
    o.writeBoolean(visible);
    o.writeLong(drawingTime);
    o.writeBoolean(isShown);
    o.writeBoolean(hasFocus);
    o.writeBoolean(focusable);
    o.writeBoolean(hasOnClickListener);
    o.writeObject(viewType);
    o.writeObject(textContent);
    o.writeBoolean(isEditText);
    o.writeBoolean(isInputMethodTarget);
    o.writeBoolean(isContainer);
    o.writeInt(inputMethod);
    o.writeInt(id);

    if (children != null) {
      o.writeInt(children.size());
      for (ViewComponentInfo child : children) {
        child.writeTo(o);
      }
    } else {
      o.writeInt(0);
    }
  }
  private static void writeOnPrimitive(
      final ObjectOutput out, final Object obj, final ClassMetadataField metaField)
      throws IOException {

    try {
      final Field field = metaField.getField();
      final Class clazz = field.getType();
      if (clazz == Integer.TYPE) {
        out.writeInt(FieldsManager.getFieldsManager().getInt(obj, metaField));
      } else if (clazz == Byte.TYPE) {
        out.writeByte(FieldsManager.getFieldsManager().getByte(obj, metaField));
      } else if (clazz == Long.TYPE) {
        out.writeLong(FieldsManager.getFieldsManager().getLong(obj, metaField));
      } else if (clazz == Float.TYPE) {
        out.writeFloat(FieldsManager.getFieldsManager().getFloat(obj, metaField));
      } else if (clazz == Double.TYPE) {
        out.writeDouble(FieldsManager.getFieldsManager().getDouble(obj, metaField));
      } else if (clazz == Short.TYPE) {
        out.writeShort(FieldsManager.getFieldsManager().getShort(obj, metaField));
      } else if (clazz == Character.TYPE) {
        out.writeChar(field.getChar(obj));
      } else if (clazz == Boolean.TYPE) {
        out.writeBoolean(field.getBoolean(obj));
      } else {
        throw new RuntimeException("Unexpected datatype " + clazz.getName());
      }
    } catch (IllegalAccessException access) {
      IOException io = new IOException(access.getMessage());
      io.initCause(access);
      throw io;
    }
  }
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    // VERSION
    out.writeByte(0);

    // SUPER
    super.writeExternal(out);

    // NO_ENTRY_KEY
    out.writeFloat(no_entry_key);

    // NUMBER OF ENTRIES
    out.writeInt(_size);

    // ENTRIES
    for (int i = _states.length; i-- > 0; ) {
      if (_states[i] == FULL) {
        out.writeFloat(_set[i]);
        out.writeObject(_values[i]);
      }
    }
  }
Example #7
0
  /** {@inheritDoc} */
  public void writeExternal(ObjectOutput out) throws IOException {
    // VERSION
    out.writeByte(0);

    // SUPER
    super.writeExternal(out);

    // NO_ENTRY_KEY
    out.writeFloat(no_entry_key);

    // NO_ENTRY_VALUE
    out.writeDouble(no_entry_value);
  }
Example #8
0
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {

    out.writeObject(this.pathway);

    out.writeObject(this.gameObjects);
    out.writeObject(this.universalObjects);

    out.writeObject(this.car);
    out.writeObject(this.background);
    out.writeObject(this.start);
    out.writeObject(this.finish);
    out.writeFloat(this.timeLimit);
    out.writeObject(this.difficulty);

    out.writeByte(Level.MAGIC_LEVEL_END);
  }
  /** {@inheritDoc} */
  public void writeExternal(ObjectOutput out) throws IOException {

    // VERSION
    out.writeByte(1);

    // SUPER
    super.writeExternal(out);

    // NUMBER OF ENTRIES
    out.writeInt(_size);

    // LOAD FACTOR -- Added version 1
    out.writeFloat(_loadFactor);

    // NO ENTRY VALUE -- Added version 1
    out.writeShort(no_entry_value);

    // ENTRIES
    for (int i = _states.length; i-- > 0; ) {
      if (_states[i] == FULL) {
        out.writeShort(_set[i]);
      }
    }
  }
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeDouble(_0);
   out.writeFloat(_1);
   out.writeLong(_2);
 }
 public void writeFloat(float v) throws IOException {
   oo.writeFloat(v);
 }
Example #12
0
 /**
  * Write this round solid outline object to the given object output stream.
  *
  * @param out Object output stream.
  * @exception IOException Thrown if an I/O error occurred.
  */
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeFloat(myWidth);
   out.writeObject(myFill);
 }
Example #13
0
 /**
  * <code>writeExternal</code> writes this quaternion out to a <code>ObjectOutput</code> object.
  * NOTE: Used with serialization. Not to be called manually.
  *
  * @param out the object to write to.
  * @throws IOException if writing to the ObjectOutput fails.
  * @see java.io.Externalizable
  */
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeFloat(x);
   out.writeFloat(y);
   out.writeFloat(z);
   out.writeFloat(w);
 }
 @Override
 protected void writeObject(ObjectOutput out, Object obj) throws IOException {
   out.writeFloat(((Float) obj).floatValue());
 }