Package org.jboss.util.stream

Examples of org.jboss.util.stream.MarshalledValueOutputStream.writeObject()


    */
   byte[] objectToByteBufferInternal (Object obj) throws Exception
   {
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      MarshalledValueOutputStream mvos = new MarshalledValueOutputStream(baos);
      mvos.writeObject(obj);
      mvos.flush();
      return baos.toByteArray();
   }
  
   /**
 
View Full Code Here


      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      // write a marker to stream to distinguish from null value stream
      baos.write(SERIALIZABLE_VALUE);
      MarshalledValueOutputStream mvos = new MarshalledValueOutputStream(baos);
      mvos.writeObject(obj);
      mvos.flush();
      return baos.toByteArray();
   }
  
   private void notifyChannelLock()
View Full Code Here

     * Serializes an object into a byte buffer. The object has to implement interface Serializable or Externalizable
     */
    byte[] objectToByteBufferInternal(Object obj) throws Exception {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        MarshalledValueOutputStream mvos = new MarshalledValueOutputStream(baos);
        mvos.writeObject(obj);
        mvos.flush();
        return baos.toByteArray();
    }

    /**
 
View Full Code Here

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        // write a marker to stream to distinguish from null value stream
        baos.write(SERIALIZABLE_VALUE);
        MarshalledValueOutputStream mvos = new MarshalledValueOutputStream(baos);
        mvos.writeObject(obj);
        mvos.flush();
        return baos.toByteArray();
    }

    private void notifyChannelLock() {
View Full Code Here

                    if (provider instanceof StateTransferStreamProvider) {
                        ((StateTransferStreamProvider) provider).getCurrentState(ostream);
                    } else {
                        MarshalledValueOutputStream mvos = new MarshalledValueOutputStream(ostream);
                        toClose = mvos;
                        mvos.writeObject(state);
                    }
                } catch (Exception ex) {
                    CoreGroupCommunicationService.this.log.error("getState failed for service " + serviceName, ex);
                } finally {
                    if (toClose != null) {
View Full Code Here

                MarshalledValueOutputStream mvos = null;
                Object state = provider.getCurrentState();
                try {
                    ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
                    mvos = new MarshalledValueOutputStream(baos);
                    mvos.writeObject(state);
                    mvos.flush();
                    mvos.close();
                    return baos.toByteArray();
                } catch (Exception ex) {
                    CoreGroupCommunicationService.this.log.error("getState failed for service " + serviceName, ex);
View Full Code Here

    */
   public static byte[] objectToByteBuffer(Object obj) throws Exception
   {
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      MarshalledValueOutputStream out = new MarshalledValueOutputStream(baos);
      out.writeObject(obj);
      out.close();
      return baos.toByteArray();
   }

}
View Full Code Here

               }
               else
               {
                  MarshalledValueOutputStream mvos = new MarshalledValueOutputStream(ostream);
                  toClose = mvos;
                  mvos.writeObject(state);
               }
            }
            catch (Exception ex)
            {
               CoreGroupCommunicationService.this.log.error("getState failed for service " + serviceName, ex);
View Full Code Here

            Object state = provider.getCurrentState();
            try
            {
               ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
               mvos = new MarshalledValueOutputStream(baos);
               mvos.writeObject(state);
               mvos.flush();
               mvos.close();
               return baos.toByteArray();
            }
            catch (Exception ex)
View Full Code Here

    */
   private byte[] objectToByteBufferInternal (Object obj) throws Exception
   {
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      MarshalledValueOutputStream mvos = new MarshalledValueOutputStream(baos);
      mvos.writeObject(obj);
      mvos.flush();
      return baos.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.