Package org.jboss.serial.io

Examples of org.jboss.serial.io.JBossObjectInputStream


        JBossObjectOutputStream objout = new JBossObjectOutputStream(byteout);
        objout.writeObject(proxy);
        objout.flush();
       
       
        JBossObjectInputStream objectInput = new JBossObjectInputStream(new ByteArrayInputStream(byteout.toByteArray()));
        ArrayList baseNew = (ArrayList)objectInput.readObject();
       
        //assertEquals(1,baseNew.size());
  }
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

        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

    JBossObjectOutputStream jbOut = new JBossObjectOutputStream(byteArray);
    jbOut.writeObject(obj);
    jbOut.flush();
   
    ByteArrayInputStream byteInput = new ByteArrayInputStream(byteArray.toByteArray());
    JBossObjectInputStream jbInpt = new JBossObjectInputStream(byteInput);
    Object newObject = jbInpt.readObject();
   
    Class[] classes = (Class[])newObject;
    assertEquals(obj[0],classes[0]);
   
  }
View Full Code Here

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

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

        assertNotSame(newObject,dataObject);
        if (!(dataObject instanceof Object[]))
        {
          assertEquals(newObject,dataObject);
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

        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

    {
      this.socketInput = socketInput;
      bufferedInputStream = new BufferedInputStream(socketInput);
      if (USE_JBSER)
      {
        input = new JBossObjectInputStream(bufferedInputStream,(ClassLoader)null);
      }
      else
      {
        input = new ObjectInputStream(bufferedInputStream);
      }
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

    JBossObjectOutputStream objOut = new JBossObjectOutputStream(byteOut);
   
    objOut.writeObject(someInstance);
    objOut.flush();
   
    JBossObjectInputStream objInput = new JBossObjectInputStream(new ByteArrayInputStream(byteOut.toByteArray()),loader);
    Object newObject = objInput.readObject();

    forceGC();
    System.out.println("Size = " + ClassMetamodelFactory.getCache().size());
   
   
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.