Package org.jboss.serial.io

Examples of org.jboss.serial.io.JBossObjectInputStream


        TestProxy proxy = TestProxy.createTestInstance();

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

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

        TestProxy newProxy = (TestProxy)objinput.readObject();

        assertEquals(proxy.getProxy().doSomething(),newProxy.getProxy().doSomething());
    }
View Full Code Here


                output.writeObject(dataObject);
                output.flush();
                buffOut.flush();

                ByteArrayInputStream inptByte = new ByteArrayInputStream(outByte.toByteArray());
                ObjectInputStream input = new JBossObjectInputStream(inptByte);

                Object obj = input.readObject();
                if (!(dataObject instanceof Object[]))
                  assertEquals(obj,dataObject);
            }

            ThreadLocalBenchmark.closeBench(dataObject.getClass().getName());
View Full Code Here

    }

    public static Object readObjectIntoJBoss(byte[] byteArray) throws Exception
    {
        ByteArrayInputStream byteInp = new ByteArrayInputStream(byteArray);
        JBossObjectInputStream objInp = new JBossObjectInputStream(byteInp);
        return objInp.readObject();
    }
View Full Code Here

        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++)
        {
            assertSame("Should always be the same reference",newObject[0],newObject[i]);
        }
View Full Code Here

        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

            out.writeObject(myTest);
            out.flush();


            ByteArrayInputStream byteInput = new ByteArrayInputStream(byteOut.toByteArray());
            JBossObjectInputStream input = new JBossObjectInputStream(byteInput,buffer);

            Object value = input.readObject();

            assertTrue(value!=myTest);
            assertTrue(value.getClass()==myTest.getClass());
            if (!(myTest instanceof String[]))assertTrue(value.equals(myTest));
        }
View Full Code Here

            out.writeObjectUsingDataContainer(myTest);
            out.flush();


            ByteArrayInputStream byteInput = new ByteArrayInputStream(byteOut.toByteArray());
            JBossObjectInputStream input = new JBossObjectInputStream(byteInput,buffer);

            Object value = input.readObjectUsingDataContainer();

            assertTrue(value!=myTest);
            assertTrue(value.getClass()==myTest.getClass());
            if (!(myTest instanceof String[]))assertTrue(value.equals(myTest));
        }
View Full Code Here

        JBossObjectOutputStream objout = new JBossObjectOutputStream(byteOut);
        LocalMarshalledValue tstValue = new LocalMarshalledValue(obj);
        objout.writeObject(tstValue);
        objout.flush();

        JBossObjectInputStream objinput = new JBossObjectInputStream(new ByteArrayInputStream(byteOut.toByteArray()));
        LocalMarshalledValue localValue = (LocalMarshalledValue)objinput.readObject();

        Object value = localValue.get();
        System.out.println(value);

        assertEquals(obj,value);
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);

       assertEquals(proxy.getProxy().doSomething(),obj.intValue());
View Full Code Here

        try {
            fis = new FileInputStream(file);
            bufStream = new BufferedInputStream(fis, 2000000);
            if (useJBS)
            {
                oos = new JBossObjectInputStream(bufStream);
            } else
            {
                oos = new ObjectInputStream(bufStream);
            }
View Full Code Here

TOP

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

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.