Package org.jboss.serial.io

Examples of org.jboss.serial.io.JBossObjectInputStream


      TestWithBigDecimal obj = TestWithBigDecimal.createTestInstance();
          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


        byte[] byteArray = byteOut.toByteArray();
        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

        Object obj = TestParent.createTestInstance();
        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

          out.writeObject(myTest);
          out.flush();
 
 
          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

        Object obj = NonSerializableTestData.createObj();
        out.writeObject(obj);
        out.flush();

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

        Object obj2 = inp.readObject();

        assertEquals(obj,obj2);
    }
View Full Code Here

    {
        return new JBossObjectOutputStream(output);
    }
    public static ObjectInput getObjectInputStream(InputStream input) throws Exception
    {
        return new JBossObjectInputStream(input);
    }
View Full Code Here

        Object obj = new TestClassReferenceTest();
        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());
    }
View Full Code Here

       System.out.println("De-serializing...");    
      
       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;

       // no exception... unit test passes
View Full Code Here

    ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
    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

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.