Package org.jboss.serial.io

Examples of org.jboss.serial.io.JBossObjectOutputStream.writeObject()


     
      ByteArrayOutputStream os = new ByteArrayOutputStream();
     
      JBossObjectOutputStream oos = new JBossObjectOutputStream(os);
     
      oos.writeObject(tm);
     
      oos.close();
     
      byte[] bytes = os.toByteArray();
     
View Full Code Here


      this.authorizations = new byte[authorizations.length][];
      for (int i = 0; i < authorizations.length; i++) {
        ba = authorizations[i];
        ByteArrayOutputStream baos = new ByteArrayOutputStream(256);
        JBossObjectOutputStream serialize = new JBossObjectOutputStream(baos);
        serialize.writeObject(ba);
        serialize.flush();
        serialize.close();
        this.authorizations[i] = baos.toByteArray();
      }
    } catch (IOException ioe) {
View Full Code Here

    } else {
      try {
        log.debug("Serializing {} for unique id", value.getClass().getName());
        ByteArrayOutputStream baos = new ByteArrayOutputStream(256);
        JBossObjectOutputStream serialize = new JBossObjectOutputStream(baos);
        serialize.writeObject(value);
        serialize.flush();
        serialize.close();
        return baos.toString("UTF-8");
      } catch (IOException ioe) {
        String fallback = value.toString();
View Full Code Here

    public void testNonSerializableOptionTrue() throws Exception
    {
        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        JBossObjectOutputStream out = new JBossObjectOutputStream(byteOut);
        Object obj = NonSerializableTestData.createObj();
        out.writeObject(obj);
        out.flush();

        ByteArrayInputStream byteInput = new ByteArrayInputStream(byteOut.toByteArray());
        JBossObjectInputStream inp = new JBossObjectInputStream(byteInput);
View Full Code Here

                    int result = objRead.getProxy().doSomething();

                    BufferedOutputStream bufOut = new BufferedOutputStream(socket.getOutputStream());
                    JBossObjectOutputStream objOut = new JBossObjectOutputStream(bufOut);

                     objOut.writeObject(new Integer(result));
                     objOut.flush();


                 }
                 catch(SocketException e)
View Full Code Here

        JBossObjectOutputStream out = new JBossObjectOutputStream(byteOut,true);
        Object obj = NonSerializableTestData.createObj();

        try
        {
            out.writeObject(obj);
            fail ("It was supposed to thrown a NonSerialiableException");
        }
        catch (Exception e)
        {
        }
View Full Code Here

        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        JBossObjectOutputStream objout = new JBossObjectOutputStream(byteOut);

        TestProxy proxy = TestProxy.createTestInstance();

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

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

        TestProxy newProxy = (TestProxy)objinput.readObject();
View Full Code Here

       assertEquals(stringSize, largeString.length());
      
       ByteArrayOutputStream byteArray = new ByteArrayOutputStream();
       JBossObjectOutputStream objOut = new JBossObjectOutputStream(byteArray);
      
       objOut.writeObject(largeString);
       objOut.close();
      
       ByteArrayInputStream byteInput = new ByteArrayInputStream(byteArray.toByteArray());
       JBossObjectInputStream objInp = new JBossObjectInputStream(byteInput);
      
View Full Code Here

              if (i==START_MEASURE)
                    ThreadLocalBenchmark.openBench(dataObject.getClass().getName(),metaData);
                ByteArrayOutputStream outByte = new ByteArrayOutputStream();
                BufferedOutputStream buffOut  = new BufferedOutputStream(outByte);
                ObjectOutputStream output = new JBossObjectOutputStream(buffOut);
                output.writeObject(dataObject);
                output.flush();
                buffOut.flush();

                ByteArrayInputStream inptByte = new ByteArrayInputStream(outByte.toByteArray());
                ObjectInputStream input = new JBossObjectInputStream(inptByte);
View Full Code Here

    public static byte[] saveObjectIntoJBoss(Object obj) throws Exception
    {
        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        JBossObjectOutputStream objOut = new JBossObjectOutputStream(byteOut);
        objOut.writeObject(obj);;

        return byteOut.toByteArray();
    }

    public static Object readObjectIntoJBoss(byte[] byteArray) throws Exception
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.