Package org.jboss.serial.io

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


     
      ByteArrayInputStream is = new ByteArrayInputStream(bytes);
     
      JBossObjectInputStream ois = new JBossObjectInputStream(is);
     
      TestMessage tm2 = (TestMessage)ois.readObject();
     
      assertEquals(tm.id, tm2.id);
     
      ois.close();
           
View Full Code Here


    BaseAuthorization[] res = new BaseAuthorization[authorizations.length];
    try {
      for (int i = 0; i < authorizations.length; i++) {
        ByteArrayInputStream bais = new ByteArrayInputStream(authorizations[i]);
        JBossObjectInputStream deserialize = new JBossObjectInputStream(bais);
        Object obj = deserialize.readObject();
        res[i] = (BaseAuthorization) obj;
      }
    } catch (ClassNotFoundException cnfe) {
      Logger log = LoggerFactory.getLogger(SavedAuthenticationImpl.class);
      log.error("Can not deserialize object, may cause rights to be lost.", cnfe);
View Full Code Here

         out.flush();

         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());

         JBossObjectInputStream is = new JBossObjectInputStream(bais);
         bean = (ClusteredStatefulBean)is.readObject();
      }
      catch (IOException e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here

         out.flush();

         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());

         JBossObjectInputStream is = new JBossObjectInputStream(bais);
         bean = (StatefulBean)is.readObject();
      }
      catch (IOException e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here

         out.flush();

         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());

         JBossObjectInputStream is = new JBossObjectInputStream(bais);
         bean = (TreeCacheStatefulBase) is.readObject();
      }
      catch (IOException e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here

                    //Object obj = objStream.readObject();



                    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);
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

        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

                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

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.