Package org.jboss.serial.io

Examples of org.jboss.serial.io.JBossObjectOutputStream


   }

   public ObjectOutputStream createOutput(OutputStream output) throws IOException
   {
      if (trace) { log.trace(this + " creating JBossObjectOutputStream"); }
      return new JBossObjectOutputStream(output, new StringUtilBuffer(10024, 10024));
   }
View Full Code Here


      file.deleteOnExit();
      log.debug("saving state to " + file);
      try
      {
         FileOutputStream fos = FOSAction.open(file);
         ObjectOutputStream out = new JBossObjectOutputStream(fos);
         try
         {
            out.writeObject(obj);
            out.flush();
         }
         finally
         {
            out.close();
         }
      }
      catch(IOException e)
      {
         throw new RuntimeException("failed to store object " + obj.getId(), e);
View Full Code Here

      {
         FileOutputStream fos = FOSAction.open(file);
         // todo need to rewrite SessionObjectOutputStream to support EJB3 classes
         ObjectOutputStream out;

         out = new JBossObjectOutputStream(fos, false);

         try
         {
            out.writeObject(ctx);
            out.flush();
View Full Code Here

   {
      if (trace) { log.trace(this + " creating JBossObjectOutputStream"); }

      if (SecurityUtility.skipAccessControl())
      {
         return new JBossObjectOutputStream(output, new StringUtilBuffer(10024, 10024));
      }
     
      try
      {
         return (ObjectOutputStream)AccessController.doPrivileged( new PrivilegedExceptionAction()
         {
            public Object run() throws Exception
            {
               return new JBossObjectOutputStream(output, new StringUtilBuffer(10024, 10024));
            }
         });
      }
      catch (PrivilegedActionException e)
      {
View Full Code Here

      {
         FileOutputStream fos = FOSAction.open(file);
         // todo need to rewrite SessionObjectOutputStream to support EJB3 classes
         ObjectOutputStream out;

         out = new JBossObjectOutputStream(fos, false);

         try
         {
            out.writeObject(ctx);
            out.flush();
View Full Code Here

      {
         FileOutputStream fos = FOSAction.open(file);
         // todo need to rewrite SessionObjectOutputStream to support EJB3 classes
         ObjectOutputStream out;

         out = new JBossObjectOutputStream(fos, false);

         try
         {
            out.writeObject(ctx);
            out.flush();
View Full Code Here

            fos = new FileOutputStream(file);
            bufStream = new BufferedOutputStream(fos, 200000);
            if (useJBS)
            {
                oos = new JBossObjectOutputStream(bufStream);
            } else
            {
                oos = new ObjectOutputStream(bufStream);
            }
View Full Code Here

       String largeString = sb.toString();
       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);
      
       String newString = (String)objInp.readObject();
View Full Code Here

   }

  // do not change these testcases as they test the interface used by JBossRemoting
    private void doTestJBossDataContainerWithSmartClone2(Object dataObject) throws Exception
    {
      JBossObjectOutputStream objInput = new JBossObjectOutputStream(null);
      Object newObject = objInput.smartClone(dataObject);


      if (!(dataObject instanceof String) && !(dataObject instanceof String[]))
      {
        assertEquals(dataObject,newObject);
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);
            System.out.println(myTest.getClass().getName() +" produced " + byteArray.length + " on JBossSerialization");
View Full Code Here

TOP

Related Classes of org.jboss.serial.io.JBossObjectOutputStream

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.