Package org.jboss.serial.io

Examples of org.jboss.serial.io.JBossObjectInputStream.readObject()


      JBossObjectOutputStream objOut = new JBossObjectOutputStream(byteOut);
      objOut.writeObject(proxyPoint);
     
      ByteArrayInputStream byteInp = new ByteArrayInputStream(byteOut.toByteArray());
      JBossObjectInputStream objInput = new JBossObjectInputStream(byteInp);
      DataPoint proxyPoint2 = (DataPoint)objInput.readObject();
     
      try
      {
        proxyPoint2.exception();
        fail("An exception should be generated");
View Full Code Here


          ByteArrayOutputStream byteout = new ByteArrayOutputStream();
          JBossObjectOutputStream out = new JBossObjectOutputStream (byteout);
          out.writeObject(obj);
          out.flush();
          JBossObjectInputStream inp = new JBossObjectInputStream (new ByteArrayInputStream(byteout.toByteArray()));
          TestWithBigDecimal obj2 = (TestWithBigDecimal)inp.readObject();
          assertTrue(obj!=obj2);
          assertEquals(obj,obj2);
         
          BigDecimal result = obj2.getValue().add(obj2.getValue2());
          System.out.println("result = " + result);
View Full Code Here

        System.out.println(myTest.getClass().getName() +" produced " + byteArray.length + " on JBossSerialization");
        ByteArrayInputStream byteInput = new ByteArrayInputStream(byteArray);

        JBossObjectInputStream input = new JBossObjectInputStream(byteInput);

        Object value = input.readObject();

        assertNotSame(myTest,value);
        if (!(myTest instanceof String) && !(myTest instanceof String[]))
        {
            assertSame(myTest.getClass(),value.getClass());
View Full Code Here

        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        JBossObjectOutputStream out = new JBossObjectOutputStream (byteout);
        out.writeObject(obj);
        out.flush();
        JBossObjectInputStream inp = new JBossObjectInputStream (new ByteArrayInputStream(byteout.toByteArray()));
        Object obj2 = inp.readObject();
        assertTrue(obj!=obj2);
        assertEquals(obj,obj2);
    }
}
View Full Code Here

 
 
          ByteArrayInputStream byteInput = new ByteArrayInputStream(byteOut.toByteArray());
          JBossObjectInputStream input = new JBossObjectInputStream(byteInput,buffer);
 
          Object value = input.readObject();
 
          assertSame(myTest.getClass(),value.getClass());
          assertEquals(myTest,value);
    }
    catch (Exception e)
View Full Code Here

        out.flush();

        ByteArrayInputStream byteInput = new ByteArrayInputStream(byteOut.toByteArray());
        JBossObjectInputStream inp = new JBossObjectInputStream(byteInput);

        Object obj2 = inp.readObject();

        assertEquals(obj,obj2);
    }

    public void testNonSerializableOptionfalse() throws Exception
View Full Code Here

        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        JBossObjectOutputStream out = new JBossObjectOutputStream (byteout);
        out.writeObject(obj);
        out.flush();
        JBossObjectInputStream inp = new JBossObjectInputStream (new ByteArrayInputStream(byteout.toByteArray()));
        Object obj2 = inp.readObject();
        assertTrue(obj!=obj2);
        assertEquals(obj,obj2);
    }

}
View Full Code Here

        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        JBossObjectOutputStream out = new JBossObjectOutputStream (byteout);
        out.writeObject(proxy);
        out.flush();
        JBossObjectInputStream inp = new JBossObjectInputStream (new ByteArrayInputStream(byteout.toByteArray()));
        InterfaceForProxy proxy2 = (InterfaceForProxy)inp.readObject();
        assertEquals(6,proxy2.doSomething());
    }

    private InterfaceForProxy createProxy() {
        ProxiedClass proxyClass = new ProxiedClass(2);
View Full Code Here

       String tmp= System.getProperty("java.io.tmpdir") + "/";
      
       FileInputStream fis = new FileInputStream(tmp + fileName);
       JBossObjectInputStream ois = new JBossObjectInputStream(fis);
      
       Object data = ois.readObject();   
      
       ois.close();
       fis.close();
      
       return data;
View Full Code Here

    JBossObjectOutputStream objOut = new JBossObjectOutputStream(byteOut);
    TestReadResolveNull objNull = TestReadResolveNull.createTestInstance();
    objOut.writeObject(objNull);
    objOut.close();
    ObjectInputStream input = new JBossObjectInputStream(new ByteArrayInputStream(byteOut.toByteArray()));
    Object obj = input.readObject();
    assertNull(obj);
   
    System.out.println("obj=" + obj);
  }
 
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.