Package org.jboss.serial.io

Examples of org.jboss.serial.io.JBossObjectOutputStream


                    ObjectInput containerInput = new JBossObjectInputStream(bufStream);
                    TestProxy objRead = (TestProxy)containerInput.readObject();
                    int result = objRead.getProxy().doSomething();

                    BufferedOutputStream bufOut = new BufferedOutputStream(socket.getOutputStream());
                    JBossObjectOutputStream objOut = new JBossObjectOutputStream(bufOut);

                     objOut.writeObject(new Integer(result));
                     objOut.flush();


                 }
                 catch(SocketException e)
                 {
View Full Code Here


    }

    public void testNonSerializableOptionfalse() throws Exception
    {
        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        JBossObjectOutputStream out = new JBossObjectOutputStream(byteOut,true);
        Object obj = NonSerializableTestData.createObj();

        try
        {
            out.writeObject(obj);
            fail ("It was supposed to thrown a NonSerialiableException");
        }
        catch (Exception e)
        {
        }
View Full Code Here

public class ProxyTestCase extends TestCase
{
    public void testProxy() throws Exception
    {
        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        JBossObjectOutputStream objout = new JBossObjectOutputStream(byteOut);

        TestProxy proxy = TestProxy.createTestInstance();

        objout.writeObject(proxy);
        objout.flush();

        JBossObjectInputStream objinput = new JBossObjectInputStream(new ByteArrayInputStream(byteOut.toByteArray()));

        TestProxy newProxy = (TestProxy)objinput.readObject();
View Full Code Here

            {
              if (i==START_MEASURE)
                    ThreadLocalBenchmark.openBench(dataObject.getClass().getName(),metaData);
                ByteArrayOutputStream outByte = new ByteArrayOutputStream();
                BufferedOutputStream buffOut  = new BufferedOutputStream(outByte);
                ObjectOutputStream output = new JBossObjectOutputStream(buffOut);
                output.writeObject(dataObject);
                output.flush();
                buffOut.flush();

                ByteArrayInputStream inptByte = new ByteArrayInputStream(outByte.toByteArray());
                ObjectInputStream input = new JBossObjectInputStream(inptByte);
View Full Code Here

public class SerialTestUtil {

    public static byte[] saveObjectIntoJBoss(Object obj) throws Exception
    {
        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        JBossObjectOutputStream objOut = new JBossObjectOutputStream(byteOut);
        objOut.writeObject(obj);;

        return byteOut.toByteArray();
    }
View Full Code Here

    public void testCalendarJBoss() throws Exception
    {
        Calendar calendar = new GregorianCalendar();
        calendar.setTimeInMillis(System.currentTimeMillis());
        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        JBossObjectOutputStream os = new JBossObjectOutputStream(byteOut );
        os.writeObject(calendar);
        os.flush();
        os.close();

        ByteArrayInputStream byteInpt = new ByteArrayInputStream(byteOut.toByteArray());
        JBossObjectInputStream is = new JBossObjectInputStream(byteInpt);
        Calendar c = (Calendar) is.readObject();
        c.clone();
View Full Code Here

        {
            arrayObj[i] = dataObject;
        }

        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        JBossObjectOutputStream objOut = new JBossObjectOutputStream(byteout);
        objOut.writeObject(arrayObj);
        objOut.flush();

        JBossObjectInputStream objInput = new JBossObjectInputStream(new ByteArrayInputStream(byteout.toByteArray()));
        Object newObject[] = (Object[]) objInput.readObject();

        for (int i=1;i<newObject.length;i++)
View Full Code Here

                original = System.currentTimeMillis();
            }

            byteOut.reset();

            JBossObjectOutputStream out = new JBossObjectOutputStream(byteOut,buffer);
            out.writeObject(myTest);
            out.flush();


            ByteArrayInputStream byteInput = new ByteArrayInputStream(byteOut.toByteArray());
            JBossObjectInputStream input = new JBossObjectInputStream(byteInput,buffer);
View Full Code Here

                original = System.currentTimeMillis();
            }

            byteOut.reset();

            JBossObjectOutputStream out = new JBossObjectOutputStream(byteOut,buffer);
            out.writeObjectUsingDataContainer(myTest);
            out.flush();


            ByteArrayInputStream byteInput = new ByteArrayInputStream(byteOut.toByteArray());
            JBossObjectInputStream input = new JBossObjectInputStream(byteInput,buffer);
View Full Code Here

    }

    public void testClientCall() throws Exception
    {

       ObjectOutput output = new JBossObjectOutputStream(socket.getOutputStream());
       ObjectInput input = new JBossObjectInputStream((socket.getInputStream()));

       TestProxy proxy = TestProxy.createTestInstance();
       output.writeObject(proxy);
       output.flush();

       Integer obj = (Integer)input.readObject();

       System.out.println("response: " + obj);
View Full Code Here

TOP

Related Classes of org.jboss.serial.io.JBossObjectOutputStream

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.