Пример #1
0
  /**
   * This is called to read this object <code>InPort</code> from the specified object of input
   * stream.
   *
   * @param is DataInput object
   * @param versionNo Description of the Parameter
   * @exception IOException if an error occurs while reading bytes or while converting them into
   *     specified Java primitive type.
   * @since Tifosi2.0
   */
  public void fromStream(DataInput is, int versionNo) throws IOException {
    super.fromStream(is, versionNo);

    m_strPortName = readUTF(is);
    m_strDscription = readUTF(is);
    m_strXSD = readUTF(is);
    m_strJavaClass = readUTF(is);
    m_bIsSyncRequestType = is.readBoolean();

    int size = is.readInt();

    for (int i = 0; i < size; ++i) {
      Param param = new Param();

      param.fromStream(is, versionNo);
      m_params.addElement(param);
    }
  }
Пример #2
0
  /**
   * This method is called to write this object of <code>InPort</code> to the specified output
   * stream object.
   *
   * @param out DataOutput object
   * @param versionNo Description of the Parameter
   * @exception IOException if an error occurs while converting data and writing it to a binary
   *     stream.
   * @since Tifosi2.0
   */
  public void toStream(DataOutput out, int versionNo) throws IOException {
    super.toStream(out, versionNo);

    writeUTF(out, m_strPortName);
    writeUTF(out, m_strDscription);
    writeUTF(out, m_strXSD);
    writeUTF(out, m_strJavaClass);
    out.writeBoolean(m_bIsSyncRequestType);

    if (m_params != null && m_params.size() > 0) {
      int num = m_params.size();

      out.writeInt(num);
      for (int i = 0; i < num; ++i) {
        Param param = (Param) m_params.elementAt(i);

        param.toStream(out, versionNo);
      }
    } else {
      out.writeInt(0);
    }
  }