Package org.jboss.serial.io

Examples of org.jboss.serial.io.JBossObjectInputStream


    ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
    ObjectOutputStream objOut = new JBossObjectOutputStream(byteOut);
    TestReferences obj1 = new TestReferences();
    objOut.writeObject(obj1);
    objOut.close();
    ObjectInputStream input = new JBossObjectInputStream(new ByteArrayInputStream(byteOut.toByteArray()));
    Object obj2 = input.readObject();
   
    System.out.println("obj2=" + obj2);
   
  }
View Full Code Here


                    //ObjectInputStream objStream = new ObjectInputStream(bufStream);
                    //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

{
  protected Object read(String fileName) throws Exception
  {
       System.out.println("De-serializing...");      
       FileInputStream fis = new FileInputStream(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

    }

    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

/*    */   {
/* 68 */     SerializableWrapper wrapper = (SerializableWrapper)target;
/* 69 */     byte[] payload = wrapper.getPayload();
/* 70 */     ByteArrayInputStream bais = new ByteArrayInputStream(payload);
/* 71 */     ObjectInputStream ois = new ObjectInputStream(bais);
/* 72 */     JBossObjectInputStream jbis = new JBossObjectInputStream(ois);
/* 73 */     Object result = jbis.readObject();
/* 74 */     return result;
/*    */   }
View Full Code Here

/*  52 */   private static boolean trace = log.isTraceEnabled();
/*     */
/*     */   public ObjectInputStream createInput(InputStream input, ClassLoader loader) throws IOException
/*     */   {
/*  56 */     if (trace) log.trace(this + " creating JBossObjectInputStream");
/*  57 */     return new JBossObjectInputStream(input, loader, new StringUtilBuffer(10024, 10024));
/*     */   }
View Full Code Here

/*     */     }
/* 170 */     log.debug("loading state from " + file);
/*     */     try
/*     */     {
/* 173 */       FileInputStream fis = FISAction.open(file);
/* 174 */       ObjectInputStream in = new JBossObjectInputStream(fis);
/*     */       try
/*     */       {
/* 177 */         Identifiable localIdentifiable = (Identifiable)in.readObject();
/*     */         return localIdentifiable;
/*     */       }
/*     */       finally
/*     */       {
/* 181 */         in.close();
/* 182 */         DeleteFileAction.delete(file);
/*     */       }
/*     */     }
/*     */     catch (ClassNotFoundException e)
/*     */     {
View Full Code Here

/* 287 */     StatefulBeanContext bean = null;
/*     */     try
/*     */     {
/* 290 */       FileInputStream fis = FISAction.open(file);
/*     */
/* 294 */       ObjectInputStream in = new JBossObjectInputStream(new BufferedInputStream(fis));
/*     */       try
/*     */       {
/* 297 */         bean = (StatefulBeanContext)in.readObject();
/*     */       }
/*     */       finally
/*     */       {
/* 301 */         fis.close();
/* 302 */         in.close();
/*     */       }
/*     */     }
/*     */     catch (EJBException e)
/*     */     {
/* 307 */       throw e;
View Full Code Here

/*     */     {
/*     */       try
/*     */       {
/* 332 */         FileInputStream fis = FISAction.open(file);
/*     */
/* 334 */         ObjectInputStream in = new JBossObjectInputStream(new BufferedInputStream(fis));
/*     */         try
/*     */         {
/* 337 */           StatefulBeanContext bean = (StatefulBeanContext)in.readObject();
/* 338 */           beans.add(bean);
/*     */         }
/*     */         finally
/*     */         {
/* 342 */           fis.close();
/* 343 */           in.close();
/*     */         }
/*     */       }
/*     */       catch (Exception e)
/*     */       {
/* 348 */         log.warn("Could not read for timeout removal for file " + file.getName(), e);
View Full Code Here

     
      log.debug("loading state from " + file);
      try
      {
         FileInputStream fis = FISAction.open(file);
         ObjectInputStream in = new JBossObjectInputStream(fis);
         try
         {
            return (T) in.readObject();
         }
         finally
         {
            in.close();
            DeleteFileAction.delete(file);
         }
      }
      catch(ClassNotFoundException e)
      {
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.