Package org.omg.CORBA.portable

Examples of org.omg.CORBA.portable.OutputStream


    public boolean non_existent(org.omg.CORBA.Object obj)
    {
        InputStream is = null;
        try {
            OutputStream os = request(null, "_non_existent", true);
            is = (InputStream) invoke((org.omg.CORBA.Object)null, os);

            return is.read_boolean();

        } catch (ApplicationException e) {
View Full Code Here


    protected abstract boolean initializeComponentsFromTypeCode();

    // Collapses the whole DynAny hierarchys values into one single streamed Any
    protected boolean initializeAnyFromComponents() {
        //System.out.println(this + " initializeAnyFromComponents");
        OutputStream out = any.create_output_stream();
        for (int i=0; i<components.length; i++) {
            if (components[i] instanceof DynAnyImpl) {
                ((DynAnyImpl)components[i]).writeAny(out);
            } else {
                // Not our implementation. Nothing we can do to prevent copying.
                components[i].to_any().write_value(out);
            }
        }
        any.read_value(out.create_input_stream(), any.type());
        return true;
    }
View Full Code Here

        return true;
    }

    // Collapses the whole DynAny hierarchys values into one single streamed Any
    protected boolean initializeAnyFromComponents() {
        OutputStream out = any.create_output_stream();
        // Writing the length first is the only difference to supers implementation
        out.write_long(components.length);
        for (int i=0; i<components.length; i++) {
            if (components[i] instanceof DynAnyImpl) {
                ((DynAnyImpl)components[i]).writeAny(out);
            } else {
                // Not our implementation. Nothing we can do to prevent copying.
                components[i].to_any().write_value(out);
            }
        }
        any.read_value(out.create_input_stream(), any.type());
        return true;
    }
View Full Code Here

        }
    }

    @Test
    public void testReadBoolean() {
        OutputStream oStream = orb.create_output_stream();
        oStream.write_boolean(true);
       
        InputStream iStream = oStream.create_input_stream();
        CorbaObjectReader reader = new CorbaObjectReader(iStream);
       
        Boolean boolValue = reader.readBoolean();
        assertTrue(boolValue.booleanValue());
    }
View Full Code Here

        assertTrue(boolValue.booleanValue());
    }
   
    @Test
    public void testReadChar() {
        OutputStream oStream = orb.create_output_stream();
        oStream.write_char('c');
       
        InputStream iStream = oStream.create_input_stream();
        CorbaObjectReader reader = new CorbaObjectReader(iStream);
       
        Character charValue = reader.readChar();
        assertTrue(charValue.charValue() == 'c');
    }
View Full Code Here

        assertTrue(charValue.charValue() == 'c');
    }
   
    @Test
    public void testReadWChar() {
        OutputStream oStream = orb.create_output_stream();
        oStream.write_wchar('w');
       
        InputStream iStream = oStream.create_input_stream();
        CorbaObjectReader reader = new CorbaObjectReader(iStream);
       
        Character wcharValue = reader.readWChar();
        assertTrue(wcharValue.charValue() == 'w');
    }
View Full Code Here

        assertTrue(wcharValue.charValue() == 'w');
    }
   
    @Test
    public void testReadOctet() {
        OutputStream oStream = orb.create_output_stream();
        oStream.write_octet((byte)27);
       
        InputStream iStream = oStream.create_input_stream();
        CorbaObjectReader reader = new CorbaObjectReader(iStream);
       
        Byte octetValue = reader.readOctet();
        assertTrue(octetValue.byteValue() == (byte)27);
    }
View Full Code Here

        assertTrue(octetValue.byteValue() == (byte)27);
    }
   
    @Test
    public void testReadShort() {
        OutputStream oStream = orb.create_output_stream();
        oStream.write_short((short)-100);
       
        InputStream iStream = oStream.create_input_stream();
        CorbaObjectReader reader = new CorbaObjectReader(iStream);
       
        Short shortValue = reader.readShort();
        assertTrue(shortValue.shortValue() == (short)-100);
    }
View Full Code Here

        assertTrue(shortValue.shortValue() == (short)-100);
    }
   
    @Test
    public void testReadUShort() {
        OutputStream oStream = orb.create_output_stream();
        oStream.write_ushort((short)100);
       
        InputStream iStream = oStream.create_input_stream();
        CorbaObjectReader reader = new CorbaObjectReader(iStream);
       
        Integer ushortValue = reader.readUShort();
        assertTrue(ushortValue.intValue() == 100);
    }
View Full Code Here

        assertTrue(ushortValue.intValue() == 100);
    }
   
    @Test
    public void testReadLong() {
        OutputStream oStream = orb.create_output_stream();
        oStream.write_long(-100000);
       
        InputStream iStream = oStream.create_input_stream();
        CorbaObjectReader reader = new CorbaObjectReader(iStream);
       
        Integer longValue = reader.readLong();
        assertTrue(longValue.intValue() == -100000);
    }
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.