Package org.jacorb.orb

Examples of org.jacorb.orb.CDRInputStream


                0x30, (byte) (0xFA & 0xff),
                0x30, (byte) (0xB7 & 0xff),
                0, 0,                       // two-byte null terminator
                0x5, (byte) (0xD1 & 0xff)// Hebrew letter beis
        };
        CDRInputStream stream = new CDRInputStream( orb, codedText );
        stream.setGIOPMinor( 1 );
        assertEquals( "wstring value", "\u30DF\u30C4\u30FA\u30B7", stream.read_wstring() );

        assertEquals( "wchar 1", '\u05D1', stream.read_wchar() );
    }
View Full Code Here


    {
        byte[] codedText = {0, 0, 0, 5,                    // string length in bytes, including null pointer
                'a', 's', 'd', 'f', 0,         // one-byte null terminator
                'x'
        };
        CDRInputStream stream = new CDRInputStream( orb, codedText );
        selectCodeSets( stream, "UTF8", "UTF8" );
        stream.setGIOPMinor( 1 );
        assertEquals( "sstring value", "asdf", stream.read_string() );

        assertEquals( "char 1", 'x', stream.read_char() );
    }
View Full Code Here

                (byte) (0xE3 & 0xff), (byte) (0x83 & 0xff), (byte) (0x9F & 0xff),    // Mitsubishi, in Katakana
                (byte) (0xE3 & 0xff), (byte) (0x83 & 0xff), (byte) (0x84 & 0xff),
                (byte) (0xE3 & 0xff), (byte) (0x83 & 0xff), (byte) (0xBA & 0xff),
                (byte) (0xE3 & 0xff), (byte) (0x82 & 0xff), (byte) (0xB7 & 0xff),
        };
        CDRInputStream stream = new CDRInputStream( orb, codedText );
        selectCodeSets( stream, "ISO8859_1", "UTF8" );
        assertEquals( "wchar 1", 'x', stream.read_wchar() );
        assertEquals( "wchar 2", '\u05D0', stream.read_wchar() );
        assertEquals( "wchar 3", '\u3051', stream.read_wchar() );
        assertEquals( "wchar 4", '\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

       final org.omg.CORBA.portable.InputStream in;
       final BigDecimal result = new BigDecimal("432.1");

       if (arguments.contains("deprecated"))
       {
           in = new CDRInputStream(null, new byte[0])
           {
               public BigDecimal read_fixed()
               {
                   return result;
               }
           };
       }
       else
       {
           in = new CDRInputStream(null, new byte[0])
           {
               public BigDecimal read_fixed(short digits, short scale)
               {
                   assertEquals(4, digits);
                   assertEquals(1, scale);
View Full Code Here

        byte []data = sc.context_data;

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

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

      }

      Properties properties = new Properties();
      properties.put("jacorb.interop.sun", "on");
      ORB jacorborb = org.omg.CORBA.ORB.init (new String[]{}, properties);
      CDRInputStream in = new CDRInputStream(jacorborb, result);

      Something s = (Something)in.read_value();

      System.out.println("### the value is : " + s.value + "\nthe number is " + s.number);

      foreignorb.shutdown(true);
      jacorborb.shutdown(true);
View Full Code Here

      }

      Properties properties = new Properties();
      properties.put("jacorb.interop.sun", "on");
      ORB jacorborb = org.omg.CORBA.ORB.init (new String[]{}, properties);
      CDRInputStream in = new CDRInputStream(jacorborb, result);


      NegativeArgumentException n = (NegativeArgumentException)in.read_value();
      System.out.println("the value i is : " + n.i + "\nthe static value j is : " + n.j+" \nmessage " + n.getMessage());

      foreignorb.shutdown(true);
      jacorborb.shutdown(true);
      assertTrue (n.i == -10);
View Full Code Here

        CDROutputStream out = (CDROutputStream) orb.create_output_stream();
        out.write_string(input);

        byte[] buffer = out.getBufferCopy();

        CDRInputStream in = new CDRInputStream(buffer);
        String result = in.read_string();
        return result;
    }
View Full Code Here

    * on subclasses having satisfactorily implemented the
    * {@link #readAddressProfile(CDRInputStream)} method.
    */
    protected void initFromProfileData(byte[] data)
    {
        final CDRInputStream in = new CDRInputStream(null, data);

        try
        {
            in.openEncapsulatedArray();

            readAddressProfile(in);

            int length = in.read_ulong();

            if (in.available() < length)
            {
                throw new MARSHAL("Unable to extract object key. Only " + in.available() + " available and trying to assign " + length);
            }

            objectKey = new byte[length];
            in.read_octet_array(objectKey, 0, length);

            components = (version != null && version.minor > 0) ? new TaggedComponentList(in)
                    : new TaggedComponentList();
        }
        finally
        {
            in.close();
        }
    }
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

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.