Package org.jboss.serial.io

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


  //
    try
    {
      ByteArrayOutputStream out = new ByteArrayOutputStream();
        JBossObjectOutputStream oos = new JBossObjectOutputStream(out);
        oos.writeObject(serializable);
        oos.close();
       
        return Base64.encodeToString(out.toByteArray(), false);
    }
    catch(IOException ex)
View Full Code Here


      {
         FileOutputStream fos = FOSAction.open(file);
         ObjectOutputStream out = new JBossObjectOutputStream(fos);
         try
         {
            out.writeObject(obj);
            out.flush();
         }
         finally
         {
            out.close();
View Full Code Here

   public byte[] serializeToByte(final Object target) throws Exception
   {
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      OutputStream oos = new ObjectOutputStream(baos);
      JBossObjectOutputStream jbos = new JBossObjectOutputStream(oos);
      jbos.writeObject(target);
      jbos.close();  
     
      return baos.toByteArray();
     
   }
View Full Code Here

      {
         FileOutputStream fos = FOSAction.open(file);
         ObjectOutputStream out = new JBossObjectOutputStream(fos);
         try
         {
            out.writeObject(obj);
            out.flush();
         }
         finally
         {
            out.close();
View Full Code Here

      {
         FileOutputStream fos = FOSAction.open(file);
         ObjectOutputStream out = new JBossObjectOutputStream(fos);
         try
         {
            out.writeObject(obj);
            out.flush();
         }
         finally
         {
            out.close();
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

        for (int exec=0;exec<MAX_LOOP;exec++)
        {
            byteOut.reset();

            JBossObjectOutputStream out = new JBossObjectOutputStream(byteOut,buffer);
            out.writeObject(myTest);
            out.flush();


            byte[] byteArray = byteOut.toByteArray();
            saveFile("/tmp/jboss-test-" + myTest.getClass().getName() + ".bin",byteArray);
View Full Code Here

        BaseClass base = (BaseClass)proxy;
        System.out.println("Result = "+ base.doSomething(1));
       
        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        JBossObjectOutputStream objout = new JBossObjectOutputStream(byteout);
        objout.writeObject(proxy);
        objout.flush();

        SizeBenchmarkTestCase.saveFileNoCheck("/tmp/check.bin",byteout.toByteArray());
       
        JBossObjectInputStream objectInput = new JBossObjectInputStream(new ByteArrayInputStream(byteout.toByteArray()));
View Full Code Here

        BaseClass base = (BaseClass)proxy;
        System.out.println("Result = "+ base.doSomething(1));
       
        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        JBossObjectOutputStream objout = new JBossObjectOutputStream(byteout);
        objout.writeObject(proxy.getClass());
        objout.flush();

        SizeBenchmarkTestCase.saveFileNoCheck("/tmp/check.bin",byteout.toByteArray());
       
        JBossObjectInputStream objectInput = new JBossObjectInputStream(new ByteArrayInputStream(byteout.toByteArray()));
View Full Code Here

        ArrayList base = (ArrayList)proxy;
        //base.add("Test");
       
        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        JBossObjectOutputStream objout = new JBossObjectOutputStream(byteout);
        objout.writeObject(proxy);
        objout.flush();
       
       
        JBossObjectInputStream objectInput = new JBossObjectInputStream(new ByteArrayInputStream(byteout.toByteArray()));
        ArrayList baseNew = (ArrayList)objectInput.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.