示例#1
0
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   byte[] bytes = getBytes();
   out.writeInt(bytes.length);
   out.writeInt(this.numFields);
   out.write(bytes);
 }
 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]);
   }
 }
 public void writeExternal(ObjectOutput out) throws IOException {
   // esto es solo para serializar tickets que no estan en la bolsa de tickets pendientes
   out.writeObject(m_sId);
   out.writeInt(tickettype);
   out.writeInt(m_iTicketId);
   out.writeInt(m_iTicketNCF); // NCF
   out.writeObject(m_Customer);
   out.writeObject(m_dDate);
   out.writeObject(attributes);
   out.writeObject(m_aLines);
 }
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    out.writeBoolean(descColumns != null);
    if (descColumns != null) {
      out.writeInt(descColumns.length);
      for (int i = 0; i < descColumns.length; i++) out.writeBoolean(descColumns[i]);
    }

    out.writeBoolean(nullsOrderedLow != null);
    if (nullsOrderedLow != null) {
      out.writeInt(nullsOrderedLow.length);
      for (int i = 0; i < nullsOrderedLow.length; i++) out.writeBoolean(nullsOrderedLow[i]);
    }
  }
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeInt(size());
   for (int i = 0; i < size(); i++) {
     out.writeObject(get(i));
   }
 }
示例#6
0
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeInt(1); // version
   if (first instanceof Serializable) out.writeObject(first);
   else out.writeObject(null);
   if (second instanceof Serializable) out.writeObject(second);
   else out.writeObject(null);
 }
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeInt(2);
   out.writeInt(548);
   out.writeInt(348);
   byte[] bytes = new byte[1024];
   for (int i = 0; i < 548; i++) {
     bytes[i] = 1;
   }
   out.write(bytes, 0, 548);
   bytes = new byte[1024];
   for (int i = 0; i < 348; i++) {
     bytes[i] = 2;
   }
   out.write(bytes, 0, 348);
 }
  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;
    }
  }
 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;
   }
 }
示例#10
0
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeUTF(firstName);
   out.writeUTF(lastName);
   out.writeInt(age);
   out.writeObject(mother);
   out.writeObject(father);
   out.writeObject(children);
 }
  /** {@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.writeInt(_set[i]);
        out.writeInt(_values[i]);
      }
    }
  }
  /** {@inheritDoc} */
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    U.writeString(out, jobName);
    U.writeString(out, user);

    out.writeBoolean(hasCombiner);
    out.writeInt(numReduces);

    U.writeStringMap(out, props);
  }
示例#13
0
  /** {@inheritDoc} */
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    U.writeByteArray(out, src);

    out.writeInt(depMode.ordinal());

    U.writeGridUuid(out, clsLdrId);
    U.writeString(out, srcClsName);
    U.writeString(out, userVer);
    U.writeMap(out, ldrParties);
  }
示例#14
0
  /** {@inheritDoc} */
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    out.writeInt(id);

    boolean writable = innerSplit instanceof Writable;

    out.writeUTF(writable ? innerSplit.getClass().getName() : null);

    if (writable) ((Writable) innerSplit).write(out);
    else out.writeObject(innerSplit);
  }
  /**
   * @param out Object output.
   * @throws IOException If failed.
   */
  @SuppressWarnings("TypeMayBeWeakened")
  private void writeFieldsCollection(ObjectOutput out) throws IOException {
    assert fields;

    out.writeInt(data != null ? data.size() : -1);

    if (data == null) return;

    for (Object o : data) {
      List<GridIndexingEntity<?>> list = (List<GridIndexingEntity<?>>) o;

      out.writeInt(list.size());

      for (GridIndexingEntity<?> idxEnt : list) {
        try {
          out.writeObject(idxEnt.value());
        } catch (GridSpiException e) {
          throw new IOException("Failed to write indexing entity: " + idxEnt, e);
        }
      }
    }
  }
  /** {@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));
      }
    }
  }
  /** {@inheritDoc} */
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    out.writeLong(createTime);
    out.writeLong(readTime);
    out.writeLong(writeTime);
    out.writeLong(commitTime);
    out.writeLong(rollbackTime);

    out.writeInt(reads);
    out.writeInt(writes);
    out.writeInt(hits);
    out.writeInt(misses);
    out.writeInt(txCommits);
    out.writeInt(txRollbacks);
  }
示例#18
0
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    FileSystemProto.Directory.Builder dirBuilder = FileSystemProto.Directory.newBuilder();

    dirBuilder.setPath(getPath());
    dirBuilder.setLastModified(getLastModified());

    FileSystemProto.File.Builder fileBuilder = FileSystemProto.File.newBuilder();
    for (CacheFileProto child : children) {
      fileBuilder.clear();
      fileBuilder.setName(child.getShortName());
      fileBuilder.setIsDirectory(child.isDirectory());
      fileBuilder.setLastModified(child.getLastModified());
      fileBuilder.setLength(child.getLength());

      dirBuilder.addFiles(fileBuilder);
    }

    thredds.filesystem.FileSystemProto.Directory dirProto = dirBuilder.build();
    byte[] b = dirProto.toByteArray();

    out.writeInt(b.length);
    out.write(b);
  }
示例#19
0
	public void writeExternal(ObjectOutput os) throws IOException
	{
		os.writeInt(id);
		os.writeInt(x);
		os.writeInt(y);
	}
示例#20
0
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeObject(base);
   out.writeInt(minOccurs);
   out.writeInt(maxOccurs);
 }
示例#21
0
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeObject(base);
   out.writeInt(start);
   out.writeInt(end);
 }
 /** {@inheritDoc} */
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeInt(cnt);
   out.writeInt(initCnt);
   out.writeBoolean(autoDel);
 }
 /** {@inheritDoc} */
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeInt(max);
 }
示例#24
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);
    }
  }
 /** {@inheritDoc} */
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeInt(taskNameHash);
 }