Package org.apache.yoko.orb.CORBA

Examples of org.apache.yoko.orb.CORBA.OutputStream


        obj.addMember(member4Obj);

        // Write to an output stream the way a CORBA application would marshal the data for the nested
        // struct.
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
       
        oStream.write_string(nestedMember1Value);
        oStream.write_boolean(nestedMember2Value.booleanValue());
        oStream.write_fixed(fixedValue.movePointRight(2));
        oStream.write_long(enumIndex);
        oStream.write_float(floatValue.floatValue());
       
        InputStream iStream = oStream.create_input_stream();
        CorbaObjectReader reader = new CorbaObjectReader(iStream);
        reader.read(obj);       
       
        // Now that the Object has its values, try and write it to Stax
        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
View Full Code Here


        TypeCode objTypeCode = orb.get_primitive_tc(TCKind.tk_char);
        CorbaPrimitiveHandler obj = new CorbaPrimitiveHandler(objName, objIdlType, objTypeCode, null);
        CorbaStreamable streamable = new CorbaStreamable(obj, objName);
       
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
        oStream.write_char('c');
       
        InputStream iStream = oStream.create_input_stream();
        streamable._read(iStream);
        CorbaPrimitiveHandler streamableObj = (CorbaPrimitiveHandler)streamable.getObject();
        Object o = streamableObj.getValue();
       
        assertTrue(o instanceof Character);
View Full Code Here

        CorbaPrimitiveHandler obj = new CorbaPrimitiveHandler(objName, objIdlType, objTypeCode, null);
        obj.setValueFromData("TestWString");
        CorbaStreamable streamable = new CorbaStreamable(obj, objName);
       
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
        streamable._write(oStream);
       
        InputStream iStream = oStream.create_input_stream();
        String value = iStream.read_wstring();
        assertTrue(value.equals("TestWString"));
    }
View Full Code Here

        }
    }

    public void testWriteBoolean() {
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
       
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        Boolean boolValue = new Boolean(true);
        writer.writeBoolean(boolValue);
       
        InputStream iStream = oStream.create_input_stream();
        boolean b = iStream.read_boolean();
        assertTrue(b == boolValue.booleanValue());
    }
View Full Code Here

        assertTrue(b == boolValue.booleanValue());
    }
   
    public void testWriteChar() {
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
       
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        Character charValue = new Character('c');
        writer.writeChar(charValue);
       
        InputStream iStream = oStream.create_input_stream();
        char c = iStream.read_char();
        assertTrue(c == charValue.charValue());
    }
View Full Code Here

        assertTrue(c == charValue.charValue());
    }

    public void testWriteWChar() {
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
       
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        Character wcharValue = new Character('w');
        writer.writeChar(wcharValue);
       
        InputStream iStream = oStream.create_input_stream();
        char wc = iStream.read_char();
        assertTrue(wc == wcharValue.charValue());
    }
View Full Code Here

        assertTrue(wc == wcharValue.charValue());
    }
   
    public void testWriteShort() {
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
       
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        Short shortValue = new Short((short)-123);
        writer.writeShort(shortValue);
       
        InputStream iStream = oStream.create_input_stream();
        short s = iStream.read_short();
        assertTrue(s == shortValue.shortValue());
    }
View Full Code Here

        assertTrue(s == shortValue.shortValue());
    }
   
    public void testWriteUShort() {
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
       
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        Short ushortValue = new Short((short)123);
        writer.writeUShort(ushortValue);
       
        InputStream iStream = oStream.create_input_stream();
        short us = iStream.read_ushort();
        assertTrue(us == ushortValue.shortValue());
    }
View Full Code Here

        assertTrue(us == ushortValue.shortValue());
    }
   
    public void testWriteLong() {
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
       
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        Long longValue = new Long(-1234567);
        writer.writeLong(longValue);
       
        InputStream iStream = oStream.create_input_stream();
        long l = iStream.read_long();
        assertTrue(l == longValue.longValue());
    }
View Full Code Here

        assertTrue(l == longValue.longValue());
    }
   
    public void testWriteULong() {
        Buffer buf = new Buffer();
        OutputStream oStream = new OutputStream(buf);
       
        CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
        BigInteger ulongValue = new BigInteger("1234567");
        writer.writeULong(ulongValue);
       
        InputStream iStream = oStream.create_input_stream();
        long ul = iStream.read_ulong();
        assertTrue(ul == ulongValue.longValue());
    }
View Full Code Here

TOP

Related Classes of org.apache.yoko.orb.CORBA.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.