Package org.jacorb.orb

Examples of org.jacorb.orb.CDRInputStream


        }
    }

    private static void printAlternateAddress(TaggedComponent tc)
    {
        CDRInputStream is =
        new CDRInputStream((org.omg.CORBA.ORB)null, tc.component_data);
        is.openEncapsulatedArray();
        System.out.println("\t\tAddress: " + IIOPAddress.read(is));
    }
View Full Code Here


        }
    }

    private BiDirIIOPServiceContext readBiDirContext(ServiceContext ctx)
    {
        final CDRInputStream cdr_in =
            new CDRInputStream( orb, ctx.context_data );

        try
        {
            cdr_in.openEncapsulatedArray();

            return BiDirIIOPServiceContextHelper.read(cdr_in);
        }
        finally
        {
            cdr_in.close();
        }
    }
View Full Code Here

        for( int i = 0; i < contexts.length; i++ )
        {
            if( contexts[i].context_id == TAG_CODE_SETS.value )
            {
                // TAG_CODE_SETS found, demarshall
                CDRInputStream is = new CDRInputStream( null, contexts[i].context_data );
                is.openEncapsulatedArray();

                return CodeSetContextHelper.read( is );
            }
        }
View Full Code Here

    /**
     * Decodes a CDR encapsulation of a UtcT.
     */
    public static UtcT fromCDR(byte[] buffer)
    {
        CDRInputStream in = new CDRInputStream(null, buffer);
        in.openEncapsulatedArray();
        return UtcTHelper.read(in);
    }
View Full Code Here

        // see if target requires protected requests by looking into the IOR
        CompoundSecMechList csmList = null;
        try
        {
            TaggedComponent tc = ri.get_effective_component(TAG_CSI_SEC_MECH_LIST.value);
            CDRInputStream is = new CDRInputStream( (org.omg.CORBA.ORB)null, tc.component_data);
            is.openEncapsulatedArray();
            csmList = CompoundSecMechListHelper.read( is );
        }
        catch (BAD_PARAM e)
        {
            if (logger.isDebugEnabled())
View Full Code Here

    private void calcTimingPolicies()
    {
        ServiceContext ctx = inputStream.getServiceContext(INVOCATION_POLICIES.value);
        if (ctx != null)
        {
            final CDRInputStream input = new CDRInputStream (null, ctx.context_data);

            try
            {
                input.openEncapsulatedArray();
                PolicyValue[] policy = PolicyValueSeqHelper.read (input);
                for (int i=0; i < policy.length; i++)
                {
                    if (policy[i].ptype == REQUEST_START_TIME_POLICY_TYPE.value)
                    {
                        requestStartTime = Time.fromCDR (policy[i].pvalue);
                    }
                    else if (policy[i].ptype == REQUEST_END_TIME_POLICY_TYPE.value)
                    {
                        requestEndTime = Time.fromCDR (policy[i].pvalue);
                    }
                    else if (policy[i].ptype == REPLY_END_TIME_POLICY_TYPE.value)
                    {
                        replyEndTime = Time.fromCDR (policy[i].pvalue);
                    }
                }
            }
            finally
            {
                input.close();
            }
        }
    }
View Full Code Here

        if (sc != null)
        {
            byte []data = sc.context_data;

            // This part is proprietary code to unmarshal the service context data
            CDRInputStream is = new CDRInputStream(orb, data);
            result = is.read_boolean();
            is.close();
            // End
        }

        Any nameAny = orb.create_any();
        nameAny.insert_boolean(result);
View Full Code Here

        CDROutputStream t1 = new CDROutputStream(myorb);

        t1.write_string(UNI1);

        CDRInputStream t2 = new CDRInputStream (myorb, t1.getBufferCopy());

        String result = t2.read_string();

        if( configuration == 2)
        {
            assertTrue (UNI1.equals (result));
        }
View Full Code Here

     */
    public void testDefaultEncodingChar() throws Exception
    {
        byte[] codedText = {'a', 's', 'd', 'f', 'x', 'y', 'z', '*',
                0, 0, 0, 5, 'C', 'A', 'F', 'E', 0};
        CDRInputStream stream = new CDRInputStream( orb, codedText );
        assertEquals( "char 1", 'a', stream.read_char() );
        assertEquals( "char 2", 's', stream.read_char() );
        assertEquals( "char 3", 'd', stream.read_char() );
        assertEquals( "char 4", 'f', stream.read_char() );

        char[] buffer = new char[4];
        buffer[0] = 'w';
        stream.read_char_array( buffer, 1, 3 );
        assertEquals( "char array", "wxyz", new String( buffer ) );

        assertEquals( "string value", "CAFE", stream.read_string() );
    }
View Full Code Here

                0x30, (byte) (0xDF & 0xff),    // Mitsubishi, in Katakana
                0x30, (byte) (0xC4 & 0xff),
                0x30, (byte) (0xFA & 0xff),
                0x30, (byte) (0xB7 & 0xff),
        };
        CDRInputStream stream = new CDRInputStream( orb, codedText );
        assertEquals( "wchar 1", '\u05D0', stream.read_wchar() );
        assertEquals( "wchar 2", '\u3051', stream.read_wchar() );
        assertEquals( "wchar 3", '\u3074', stream.read_wchar() );

        char[] buffer = new char[4];
        buffer[0] = '\u05D0';
        stream.read_wchar_array( buffer, 1, 3 );
        assertEquals( "wchar array", "\u05D0\u05D1\u05D2\u05D3", new String( buffer ) );

        assertEquals( "wstring value", "\u30DF\u30C4\u30FA\u30B7", stream.read_wstring() );
    }
View Full Code Here

TOP

Related Classes of org.jacorb.orb.CDRInputStream

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.