Package org.jboss.util.stream

Examples of org.jboss.util.stream.MarshalledValueInputStream.readObject()


      ByteArrayOutputStream os = new ByteArrayOutputStream();
      ObjectOutputStream oos = new MarshalledValueOutputStream(os);
      oos.writeObject(mc);
      ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
      ObjectInputStream ois = new MarshalledValueInputStream(is);
      Object o = ois.readObject();
      assertEquals(hm, o);
   }

   public void testNull()
   {
View Full Code Here


            return null;
        }

        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
        MarshalledValueInputStream input = new MarshalledValueInputStream(bais);
        Object result = input.readObject();
        input.close();
        return result;
    }

    /**
 
View Full Code Here

        {
            return null;
        }

        MarshalledValueInputStream input = new MarshalledValueInputStream(bytes);
        Object result = input.readObject();
        input.close();
        return result;
    }

    /**
 
View Full Code Here

         try
         {
            ByteArrayInputStream bais = new ByteArrayInputStream(raw);
            // use a MarshalledValueInputStream since it needs to be aware of any context class loaders on the current thread.
            ObjectInputStream ois = new MarshalledValueInputStream(bais);
            instance = ois.readObject();
            ois.close();
            bais.close();
//            raw = null;
         }
         catch (Exception e)
View Full Code Here

         return null;
      }

      ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
      MarshalledValueInputStream mvis = new MarshalledValueInputStream(bais);
      return mvis.readObject();
   }
  
   /**
    * Serializes an object into a byte buffer.
    * The object has to implement interface Serializable or Externalizable
View Full Code Here

      ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
      // read past the null/serializable byte
      bais.read();
      MarshalledValueInputStream mvis = new MarshalledValueInputStream(bais);
      return mvis.readObject();
   }
  
   /**
    * Serializes a response object into a byte buffer, optimized for response marshalling.
    * The object has to implement interface Serializable or Externalizable
View Full Code Here

         ClassLoader cl = getStateTransferClassLoader();
         SwitchContext switchContext = CoreGroupCommunicationService.this.classLoaderSwitcher.getSwitchContext(cl);
         try
         {
            MarshalledValueInputStream mvis = new MarshalledValueInputStream(is);
            this.state = (Serializable) mvis.readObject();
         }
         finally
         {
            switchContext.reset();
         }
View Full Code Here

        if (serializedForm == null)
            return null;

        ByteArrayInputStream bais = new ByteArrayInputStream(serializedForm);
        MarshalledValueInputStream mvis = new MarshalledValueInputStream(bais);
        Object retValue = mvis.readObject();
        mvis.close();
        return retValue;
    }

    public byte[] toByteArray() {
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.