Esempio n. 1
0
  /**
   * Dumps the description of a given wstring TypeCode.
   *
   * @param type the <code>TypeCode</code>
   * @param output the output stream where the TypeCode will be dumped
   * @pre <code>type</code> must be an wstring type.
   */
  public static void dump(TypeCode type, java.io.PrintWriter output) throws java.io.IOException {
    output.print("[TYPECODE]{wstring");
    try {
      if (type.length() != 0) {
        output.print('<');
        output.print(type.length());
        output.print('>');
      }
    } catch (BadKind bk) {
      throw new BAD_TYPECODE("Fault in length() operation:" + bk.toString());
    }

    output.print('}');
  }
Esempio n. 2
0
  /**
   * Dumps the description of a the marshaled value of a given TypeCode.
   *
   * @param type the <code>TypeCode</code>
   * @param input the input stream where the value is marshaled
   * @param output the output stream where the value will be dumped
   * @pre the typecode must be a wstring type
   * @return <code>true</code> if if has been possible dump the value.
   */
  public static boolean dumpValue(TypeCode type, InputStream input, java.io.PrintWriter output)
      throws java.io.IOException {
    output.print("[VALUE]{wstring");

    try {
      if (type.length() != 0) {
        output.print('<');
        output.print(type.length());
        output.print('>');
      }
    } catch (BadKind bk) {
      throw new BAD_TYPECODE("Fault in length() operation:" + bk.toString());
    }
    output.print(": \"");
    output.print(input.read_wstring());
    output.print("\"}");
    return true;
  }