Package org.jboss.util.stream

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


         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

        ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
        SwitchContext context = classLoaderSwitcher.getSwitchContext(this.getClass().getClassLoader());
        try {
            MarshalledValueInputStream mvis = new MarshalledValueInputStream(bais);
            return mvis.readObject();
        } finally {
            context.reset();
        }
    }
View Full Code Here

        // read past the null/serializable byte
        bais.read();
        SwitchContext context = classLoaderSwitcher.getSwitchContext(this.getClass().getClassLoader());
        try {
            MarshalledValueInputStream mvis = new MarshalledValueInputStream(bais);
            return mvis.readObject();
        } finally {
            context.reset();
        }
    }
View Full Code Here

        protected void setStateInternal(InputStream is) throws IOException, ClassNotFoundException {
            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

         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

         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 (instance == null) {
         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();
         }
         catch (Exception e) {
            throw new CacheException("Unable to unmarshall value", e);
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.