Package org.omg.CORBA.portable

Examples of org.omg.CORBA.portable.OutputStream


{
  private ORB orb;

  public void testCDR_Read_Write()
  {
    OutputStream out = orb.create_output_stream();
    ServiceInformationHelper.write(out, createInstance());

    ServiceInformation r =
      ServiceInformationHelper.read(out.create_input_stream());

    verifyInstance(r);
  }
View Full Code Here


  public int sleep_and_return(int duration)
  {
    InputStream in = null;
    try
      {
        OutputStream out = _request("sleep_and_return", true);
        out.write_long(duration);
        in = _invoke(out);
        return in.read_long();
      }
    catch (ApplicationException ex)
      {
View Full Code Here

  public void test(TestHarness h)
  {
    ORB orb = ORB.init(new String[ 0 ], null);
    Any an = orb.create_any();

    OutputStream out = an.create_output_stream();

    comServant object = new comServant();
    orb.connect(object);

    out.write_Object(object);

    IOR ior = IORHelper.read(out.create_input_stream());

    boolean ip = false;

    for (int i = 0; i < ior.profiles.length; i++)
      {
        if (ior.profiles [ i ].tag == TAG_INTERNET_IOP.value)
          {
            if (ip)
              h.fail("HR:One internet profile expected");
            ip = true;
            h.check(ior.profiles [ i ].profile_data.length > 0,
                    "HR:Internet profile data"
                   );
          }
      }
    h.check(ip, "HR:Internet profile present");

    h.check(object._is_a(ior.type_id), "HR id");
    h.check(ior.profiles.length > 0, "HR profiles");

    out = orb.create_any().create_output_stream();

    IORHelper.write(out, ior);

    org.omg.CORBA.Object obj = out.create_input_stream().read_Object();

    h.check(obj._is_a(ior.type_id), " HW id");
    h.check(ior.profiles.length > 0, "HW profiles");

    ip = false;
View Full Code Here

        b = in.read_octet();
        data.write(b);
      }
    while ((b & 0xFF) != 0xFF);

    OutputStream out = rh.createReply();
    OctetSeqHelper.write(out, data.toByteArray());

    return out;
  }
View Full Code Here

    _methods.put("aMethod", new Integer(1));
  }

  public OutputStream _invoke(String $method, InputStream in, ResponseHandler rh)
  {
    OutputStream out = null;
    Integer __method = (Integer) _methods.get($method);
    if (__method == null)
      throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE);

    switch (__method.intValue())
View Full Code Here

    return _id;
  }

  public static void insert(Any a, TestEnum that)
  {
    OutputStream out = a.create_output_stream();
    a.type(type());
    write(out, that);
    a.read_value(out.create_input_stream(), type());
  }
View Full Code Here

  private static String _id =
    "IDL:gnu/testlet/org/omg/DynamicAny/DynAny/Iona/TestStruct:1.0";

  public static void insert(Any a, TestStruct that)
  {
    OutputStream out = a.create_output_stream();
    a.type(type());
    write(out, that);
    a.read_value(out.create_input_stream(), type());
  }
View Full Code Here

        //
        //debug.log ("create_input_stream");
        if (AnyImpl.isStreamed[realType().kind().value()]) {
            return stream.dup();
        } else {
            OutputStream os = (OutputStream)orb.create_output_stream();
            TCUtility.marshalIn(os, realType(), value, object);

            return os.create_input_stream();
        }
    }
View Full Code Here

    // Extracts a member value according to the given TypeCode from the given complex Any
    // (at the Anys current internal stream position, consuming the anys stream on the way)
    // and returns it wrapped into a new Any
    public Any extractAny(TypeCode memberType, ORB orb) {
        Any returnValue = orb.create_any();
        OutputStream out = returnValue.create_output_stream();
        TypeCodeImpl.convertToNative(orb, memberType).copy((InputStream)stream, out);
        returnValue.read_value(out.create_input_stream(), memberType);
        return returnValue;
    }
View Full Code Here

    // This method could very well be moved into TypeCodeImpl or a common utility class,
    // but is has to be in this package.
    static public Any extractAnyFromStream(TypeCode memberType, InputStream input, ORB orb) {
        Any returnValue = orb.create_any();
        OutputStream out = returnValue.create_output_stream();
        TypeCodeImpl.convertToNative(orb, memberType).copy(input, out);
        returnValue.read_value(out.create_input_stream(), memberType);
        return returnValue;
    }
View Full Code Here

TOP

Related Classes of org.omg.CORBA.portable.OutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.