Package org.omg.CORBA.portable

Examples of org.omg.CORBA.portable.InputStream.available()


    public void testLong () throws IOException
    {
        int pre = 123;
        os.write_long(pre);
        InputStream is = os.create_input_stream();
        assertTrue(is.available() > 0);
        int post = is.read_long();
        assertEquals(pre, post);
    }

    public void testString() throws IOException
View Full Code Here


    public void testString() throws IOException
    {
        String pre = "abc";
        os.write_string(pre);
        InputStream is = os.create_input_stream();
        assertTrue(is.available() > 0);
        String post = is.read_string();
        assertEquals(pre, post);
    }

    public void testWString() throws IOException
View Full Code Here

    public void testWString() throws IOException
    {
        String pre = "abc";
        os.write_wstring(pre);
        InputStream is = os.create_input_stream();
        assertTrue(is.available() > 0);
        String post = is.read_wstring();
        assertEquals(pre, post);
    }

    public void testBoolean() throws IOException
View Full Code Here

    public void testBoolean() throws IOException
    {
        boolean pre = true;
        os.write_boolean(pre);
        InputStream is = os.create_input_stream();
        assertTrue(is.available() > 0);
        boolean post = is.read_boolean();
        assertEquals(pre, post);
    }

    public void testShort() throws IOException
View Full Code Here

    public void testShort() throws IOException
    {
        short pre = 234;
        os.write_short(pre);
        InputStream is = os.create_input_stream();
        assertTrue(is.available() > 0);
        short post = is.read_short();
        assertEquals(pre, post);
    }

    public void testReadString() throws IOException
View Full Code Here

    public void testReadString() throws IOException
    {
        os.write_string("abcde");
        InputStream is = os.create_input_stream();

        assertTrue(is.available() > 0);
        byte[] buf = new byte[is.available()];
        int readAmount = is.read(buf);
        assertTrue(readAmount > 0);

        os = orb.create_output_stream();
View Full Code Here

    {
        os.write_string("abcde");
        InputStream is = os.create_input_stream();

        assertTrue(is.available() > 0);
        byte[] buf = new byte[is.available()];
        int readAmount = is.read(buf);
        assertTrue(readAmount > 0);

        os = orb.create_output_stream();
        os.write_octet_array(buf, 0, buf.length);
View Full Code Here

        os.write_string("thing-one");
        os.write_long(123);
        os.write_string("thing-two");

        InputStream is = os.create_input_stream();
        assertTrue(is.available() > 0);
        assertEquals("thing-one", is.read_string());
        assertEquals(123, is.read_long());

        assertTrue(is.available() > 0);
        byte[] buf = new byte[is.available()];
View Full Code Here

        InputStream is = os.create_input_stream();
        assertTrue(is.available() > 0);
        assertEquals("thing-one", is.read_string());
        assertEquals(123, is.read_long());

        assertTrue(is.available() > 0);
        byte[] buf = new byte[is.available()];
        int readAmount = is.read(buf);
        assertTrue(readAmount > 0);

        os = orb.create_output_stream();
View Full Code Here

        assertTrue(is.available() > 0);
        assertEquals("thing-one", is.read_string());
        assertEquals(123, is.read_long());

        assertTrue(is.available() > 0);
        byte[] buf = new byte[is.available()];
        int readAmount = is.read(buf);
        assertTrue(readAmount > 0);

        os = orb.create_output_stream();
        os.write_octet_array(buf, 0, buf.length);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.