Package org.omg.CORBA.portable

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


    {
        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


        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()];
        int readAmount = is.read(buf);
        assertTrue(readAmount > 0);
View Full Code Here

        assertEquals(is.read_boolean(), true);
        assertEquals(is.read_char(), 'a');
        assertEquals(is.read_double(), 1.234, 0.001);
        assertEquals(is.read_float(), 2.345f, 0.001f);
        assertEquals(is.read_long(), 987);
        assertEquals(is.read_longlong(), 876);
        assertEquals(is.read_short(), (short)13);
        assertEquals(is.read_string(), "hi");
        assertEquals(is.read_ulong(), 765);
        assertEquals(is.read_ulonglong(), 567);
View Full Code Here

        ServiceContextHelper.write( outputStream, service_context );
        inputStream = outputStream.create_input_stream();

        // Constructor expects id to already have been read from stream.
        coreServiceContext = new UnknownServiceContext(
            inputStream.read_long(),
            (org.omg.CORBA_2_3.portable.InputStream)inputStream );

        id = coreServiceContext.getId();

        if (serviceContexts.get(id) != null)
View Full Code Here

    {
        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);
    }

    @Test
    public void testString() throws IOException
View Full Code Here

        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()];
        int readAmount = is.read(buf);
        assertTrue(readAmount > 0);
View Full Code Here

        assertEquals(is.read_boolean(), true);
        assertEquals(is.read_char(), 'a');
        assertEquals(is.read_double(), 1.234, 0.001);
        assertEquals(is.read_float(), 2.345f, 0.001f);
        assertEquals(is.read_long(), 987);
        assertEquals(is.read_longlong(), 876);
        assertEquals(is.read_short(), (short)13);
        assertEquals(is.read_string(), "hi");
        assertEquals(is.read_ulong(), 765);
        assertEquals(is.read_ulonglong(), 567);
View Full Code Here

        assertNotNull(data);

        OutputStream out = orb.create_output_stream();
        out.write_octet_array(data, 0, data.length);
        InputStream in = out.create_input_stream();
        assertEquals(1234, in.read_long());
    }
}
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.