/**
   * Save the base state of the instance. This method performs step finalization if it has not been
   * done before.
   *
   * @param out stream where to save the state
   * @exception IOException in case of write error
   */
  protected void writeBaseExternal(final ObjectOutput out) throws IOException {

    if (currentState == null) {
      out.writeInt(-1);
    } else {
      out.writeInt(currentState.length);
    }
    out.writeDouble(globalPreviousTime);
    out.writeDouble(globalCurrentTime);
    out.writeDouble(softPreviousTime);
    out.writeDouble(softCurrentTime);
    out.writeDouble(h);
    out.writeBoolean(forward);

    if (currentState != null) {
      for (int i = 0; i < currentState.length; ++i) {
        out.writeDouble(currentState[i]);
      }
    }

    out.writeDouble(interpolatedTime);

    // we do not store the interpolated state,
    // it will be recomputed as needed after reading

    // finalize the step (and don't bother saving the now true flag)
    try {
      finalizeStep();
    } catch (DerivativeException e) {
      IOException ioe = new IOException(e.getLocalizedMessage());
      ioe.initCause(e);
      throw ioe;
    }
  }
  @Override
  public void writeExternal(ObjectOutput output) throws IOException {
    String data;
    Date date;
    List<Cookie> cookie_list = getCookies();
    output.writeInt(cookie_list.size());
    for (Cookie cookie : cookie_list) {
      output.writeUTF(cookie.getName());
      output.writeUTF(cookie.getValue());

      data = cookie.getComment();
      output.writeBoolean(data != null);
      if (data != null) output.writeUTF(data);

      date = cookie.getExpiryDate();
      output.writeBoolean(date != null);
      if (date != null) output.writeLong(date.getTime());

      data = cookie.getDomain();
      output.writeBoolean(data != null);
      if (data != null) output.writeUTF(data);

      data = cookie.getPath();
      output.writeBoolean(data != null);
      if (data != null) output.writeUTF(data);

      output.writeBoolean(cookie.isSecure());
      output.writeInt(cookie.getVersion());
    }
  }
示例#3
0
  /**
   * Implements Externalizable interface to write serialized form
   *
   * @param s Output stream to serialize to
   */
  public void writeExternal(java.io.ObjectOutput s) throws IOException {
    // Write column names and column information
    int numFields = 0;
    if (fields == null) {
      s.writeInt(0);
    } else {
      numFields = fields.size();
      s.writeInt(numFields);
      for (int i = 0; i < numFields; i++) {
        String fieldName = (String) fields.get(i);
        s.writeUTF(fieldName);
        s.writeObject(columnInfos.get(fieldName));
      }
    }

    // Write record data
    if (records == null) {
      s.writeInt(0);
    } else {
      int numRows = records.size();
      s.writeInt(numRows);
      for (int row = 0; row < numRows; row++) {
        List record = (List) records.get(row);
        for (int col = 0; col < numFields; col++) {
          s.writeObject(record.get(col));
        }
      }
    }
  }
  @Override
  public void writeExternal(ObjectOutput objectOutput) throws IOException {
    if (uuid == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(uuid);
    }

    objectOutput.writeLong(requestId);
    objectOutput.writeLong(groupId);
    objectOutput.writeLong(companyId);
    objectOutput.writeLong(userId);
    objectOutput.writeLong(createDate);
    objectOutput.writeLong(modifiedDate);
    objectOutput.writeLong(classNameId);
    objectOutput.writeLong(classPK);
    objectOutput.writeInt(type);

    if (extraData == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(extraData);
    }

    objectOutput.writeLong(receiverUserId);
    objectOutput.writeInt(status);
  }
  @Override
  public void writeExternal(ObjectOutput objectOutput) throws IOException {
    objectOutput.writeLong(mvccVersion);

    objectOutput.writeLong(releaseId);
    objectOutput.writeLong(createDate);
    objectOutput.writeLong(modifiedDate);

    if (servletContextName == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(servletContextName);
    }

    if (schemaVersion == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(schemaVersion);
    }

    objectOutput.writeInt(buildNumber);
    objectOutput.writeLong(buildDate);

    objectOutput.writeBoolean(verified);

    objectOutput.writeInt(state);

    if (testString == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(testString);
    }
  }
示例#6
0
 @Override
 public void writeExternal(ObjectOutput output) throws IOException {
   output.writeUTF(keyTypeClassName);
   output.writeInt(version);
   output.writeInt(mergePoint);
   output.writeInt(instanceCount);
 }
示例#7
0
文件: LDA.java 项目: hqmshhxx/jmlp
  public void writeExternal(ObjectOutput out) throws IOException {
    // TODO Auto-generated method stub
    out.writeInt(_n_inputs);
    out.writeInt(_n_outputs);

    out.writeObject(_eig_mat);
  }
示例#8
0
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   byte[] bytes = getBytes();
   out.writeInt(bytes.length);
   out.writeInt(this.numFields);
   out.write(bytes);
 }
示例#9
0
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {

    out.writeObject(fixMessageArr);
    out.writeInt(objGetPosition);
    out.writeInt(objectPutPosition);
  }
示例#10
0
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeObject(chainedProperties);
   out.writeBoolean(immutable);
   out.writeBoolean(sequential);
   out.writeObject(sequentialAgenda);
   out.writeBoolean(maintainTms);
   out.writeBoolean(removeIdentities);
   out.writeBoolean(shareAlphaNodes);
   out.writeBoolean(shareBetaNodes);
   out.writeInt(permGenThreshold);
   out.writeInt(alphaNodeHashingThreshold);
   out.writeInt(compositeKeyDepth);
   out.writeBoolean(indexLeftBetaMemory);
   out.writeBoolean(indexRightBetaMemory);
   out.writeObject(indexPrecedenceOption);
   out.writeObject(assertBehaviour);
   out.writeObject(executorService);
   out.writeObject(consequenceExceptionHandler);
   out.writeObject(ruleBaseUpdateHandler);
   out.writeObject(conflictResolver);
   out.writeBoolean(advancedProcessRuleIntegration);
   out.writeBoolean(multithread);
   out.writeInt(maxThreads);
   out.writeObject(eventProcessingMode);
   out.writeBoolean(classLoaderCacheEnabled);
   out.writeBoolean(phreakEnabled);
   out.writeBoolean(declarativeAgenda);
   out.writeObject(componentFactory);
 }
  public void writeExternal(ObjectOutput objectOutput) throws IOException {
    objectOutput.writeLong(meetupsEntryId);
    objectOutput.writeLong(companyId);
    objectOutput.writeLong(userId);

    if (userName == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(userName);
    }

    objectOutput.writeLong(createDate);
    objectOutput.writeLong(modifiedDate);

    if (title == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(title);
    }

    if (description == null) {
      objectOutput.writeUTF(StringPool.BLANK);
    } else {
      objectOutput.writeUTF(description);
    }

    objectOutput.writeLong(startDate);
    objectOutput.writeLong(endDate);
    objectOutput.writeInt(totalAttendees);
    objectOutput.writeInt(maxAttendees);
    objectOutput.writeDouble(price);
    objectOutput.writeLong(thumbnailId);
  }
示例#12
0
文件: FIO.java 项目: donkang/statet
 public void writeString(final String s) throws IOException {
   final ObjectOutput out = this.out;
   if (s != null) {
     final int cn = s.length();
     ASCII:
     if (cn <= BA_LENGTH) {
       for (int ci = 0; ci < cn; ) {
         if ((s.charAt(ci++) & 0xffffff00) != 0) {
           break ASCII;
         }
       }
       if (cn <= 8) {
         out.writeInt(-cn);
         out.writeBytes(s);
         return;
       } else {
         out.writeInt(-cn);
         s.getBytes(0, cn, this.ba, 0);
         out.write(this.ba, 0, cn);
         return;
       }
     }
     out.writeInt(cn);
     out.writeChars(s);
     return;
   } else {
     out.writeInt(Integer.MIN_VALUE);
     return;
   }
 }
 /**
  * Write this object to a stream of stored objects.
  *
  * @param out write bytes here.
  * @exception IOException thrown on error
  */
 public void writeExternal(ObjectOutput out) throws IOException {
   if (SanityManager.DEBUG) {
     SanityManager.ASSERT(triggerSchemaId != null, "triggerSchemaId expected to be non-null");
     SanityManager.ASSERT(triggerTableId != null, "triggerTableId expected to be non-null");
   }
   out.writeObject(id);
   out.writeObject(name);
   out.writeObject(triggerSchemaId);
   out.writeObject(triggerTableId);
   out.writeInt(eventMask);
   out.writeBoolean(isBefore);
   out.writeBoolean(isRow);
   out.writeBoolean(isEnabled);
   out.writeObject(whenSPSId);
   out.writeObject(actionSPSId);
   if (referencedCols == null) {
     out.writeInt(0);
   } else {
     out.writeInt(referencedCols.length);
     for (int i = 0; i < referencedCols.length; i++) {
       out.writeInt(referencedCols[i]);
     }
   }
   out.writeObject(triggerDefinition);
   out.writeBoolean(referencingOld);
   out.writeBoolean(referencingNew);
   out.writeObject(oldReferencingName);
   out.writeObject(newReferencingName);
 }
示例#14
0
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   super.writeExternal(out);
   out.writeShort(eventType);
   out.writeInt(streamId);
   out.writeInt(bufferLength);
 }
示例#15
0
文件: DAGLink.java 项目: NCIP/cab2b
 /**
  * It serializes the DAGLink Object for communication with flex client
  *
  * @param out
  * @throws IOException
  */
 public void writeExternal(ObjectOutput out) throws IOException {
   // TODO Auto-generated method stub
   out.writeUTF(toolTip);
   out.writeUTF(pathId);
   out.writeBoolean(isSelected);
   out.writeInt((int) sourceNodeId);
   out.writeInt((int) destinationNodeId);
 }
示例#16
0
 public final void writeExternal(final ObjectOutput out) throws IOException {
   out.writeInt(listTable.length);
   out.writeInt(size);
   for (int i = 0; i < size; i++) {
     out.writeObject(listTable[i].key);
     out.writeObject(listTable[i].value);
   }
 }
示例#17
0
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeBoolean(reply);
   out.writeInt(uuid.length);
   out.write(uuid, 0, uuid.length);
   out.writeInt(rpcId.length);
   out.write(rpcId, 0, rpcId.length);
   out.writeObject(message);
 }
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   SpliceLogUtils.trace(LOG, "writeExternal");
   super.writeExternal(out);
   out.writeInt(leftHashKeyItem);
   out.writeInt(rightHashKeyItem);
   out.writeInt(emptyRightRowsReturned);
 }
示例#19
0
 @SuppressWarnings({"rawtypes", "unchecked"})
 private void externalizeMap(LinkedHashMap map, ObjectOutput out) throws IOException {
   int keyType = 0, valueType = 1, size;
   Iterator<Entry> it;
   Iterator cit;
   Entry e;
   Object value;
   if (map == null) {
     out.writeInt(0);
     out.flush();
     return;
   }
   size = map.keySet().size();
   if (map.keySet().iterator().next().getClass().equals(String.class)) {
     keyType = 1;
   }
   cit = map.values().iterator();
   value = cit.next();
   if (((ArrayList) value).get(0).getClass().equals(Commit.class)) {
     valueType = 0;
   } else if (((ArrayList) value).get(0).getClass().equals(PersonFrequency.class)) {
     valueType = 2;
   }
   out.writeInt(size);
   out.writeInt(keyType);
   out.writeInt(valueType);
   it = map.entrySet().iterator();
   while (it.hasNext()) {
     e = it.next();
     out.writeInt(((ArrayList) e.getValue()).size());
     cit = ((ArrayList) e.getValue()).iterator();
     while (cit.hasNext()) {
       value = cit.next();
       switch (valueType) {
         case 0:
           out.writeInt(Collections.binarySearch(allCommits, ((Commit) value)));
           break;
         case 1:
           out.writeInt(((BranchRef) value).index);
           break;
         default:
           out.writeInt(((PersonFrequency) value).index);
           out.writeInt(((PersonFrequency) value).freq);
           out.writeLong(((PersonFrequency) value).since);
           out.writeLong(((PersonFrequency) value).until);
       }
     }
     switch (keyType) {
       case 0:
         out.writeInt(Collections.binarySearch(allCommits, (Commit) e.getKey()));
         break;
       case 1:
         out.writeUTF(((String) e.getKey()));
     }
   }
   out.flush();
 }
 @Override
 protected void writeObject(ObjectOutput out, Object obj) throws IOException {
   BigDecimal val = (BigDecimal) obj;
   out.writeInt(val.scale());
   BigInteger unscaled = val.unscaledValue();
   byte[] bytes = unscaled.toByteArray();
   out.writeInt(bytes.length);
   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 {
   /* 395 */ out.writeInt(this.mCorpus.numFolds());
   /* 396 */ out.writeInt(this.mCorpus.fold());
   /* 397 */ out.writeInt(this.mCorpus.size());
   /* 398 */ for (Iterator i$ = this.mCorpus.mItemList.iterator(); i$.hasNext(); ) {
     Object f = i$.next();
     /* 399 */ out.writeObject(f);
   }
   /*     */ }
示例#23
0
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeInt(pos);
   for (int i = 0; i < pos; i++) {
     String name = classLookup[i].getName();
     out.writeInt(name.length());
     out.writeChars(name);
   }
 }
示例#24
0
 /** Implement Externalizable interface. */
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeObject(_comparator);
   out.writeObject(_keySerializer);
   out.writeObject(_valueSerializer);
   out.writeInt(_height);
   out.writeLong(_root);
   out.writeInt(_pageSize);
   out.writeInt(_entries);
 }
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeInt(index);
   out.writeByte(type);
   out.writeObject(ovalue);
   out.writeLong(lvalue);
   out.writeBoolean(bvalue);
   out.writeDouble(dvalue);
   out.writeBoolean(isNull);
   out.writeInt(hashCode);
 }
示例#26
0
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {

    out.writeInt(rows);
    out.writeInt(columns);

    for (int i = 0; i < rows * columns; i++) {
      out.writeDouble(self[i]);
    }
  }
示例#27
0
 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);
 }
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeBoolean(this.buffer != null);
   if (this.buffer != null) {
     out.writeInt(this.buffer.capacity());
     out.writeInt(this.buffer.limit());
     out.writeInt(this.buffer.position());
     for (int i = 0; i < this.buffer.capacity(); i++) {
       out.write(this.buffer.get(i));
     }
   }
 }
示例#29
0
 /**
  * Writes an array to the output.
  *
  * @param out the output instance
  * @param array reference to an array. Can be null.
  * @throws IOException
  */
 public static void writeArray(ObjectOutput out, Object[] array) throws IOException {
   if (array == null) {
     out.writeInt(0);
   } else {
     final int length = array.length;
     out.writeInt(length);
     for (int i = 0; i < length; i++) {
       out.writeObject(array[i]);
     }
   }
 }
示例#30
0
 /**
  * Writes the key-value pairs of the given map to the output.
  *
  * @param out the output instance
  * @param list reference to a Map. Can be null.
  * @throws IOException
  */
 public static void writeMap(ObjectOutput out, Map<?, ?> map) throws IOException {
   if (map == null) {
     out.writeInt(0);
   } else {
     out.writeInt(map.size());
     for (Map.Entry<?, ?> entry : map.entrySet()) {
       out.writeObject(entry.getKey());
       out.writeObject(entry.getValue());
     }
   }
 }