org.jboss.cache.marshall
Class MarshallUtil

java.lang.Object
  extended by org.jboss.cache.marshall.MarshallUtil

public class MarshallUtil
extends Object

Utility methods related to marshalling and unmarshalling objects.

Version:
$Revision$
Author:
Brian Stansberry

Constructor Summary
MarshallUtil()
           
 
Method Summary
static Object objectFromByteBuffer(byte[] bytes)
          Creates an object from a byte buffer using MarshalledValueInputStream.
static Object objectFromByteBuffer(InputStream bytes)
          Creates an object from a byte buffer using MarshalledValueInputStream.
static byte[] objectToByteBuffer(Object obj)
          Serializes an object into a byte buffer using MarshalledValueOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarshallUtil

public MarshallUtil()
Method Detail

objectFromByteBuffer

public static Object objectFromByteBuffer(byte[] bytes)
                                   throws Exception
Creates an object from a byte buffer using MarshalledValueInputStream.

Parameters:
bytes - serialized form of an object
Returns:
the object, or null if bytes is null
Throws:
Exception

objectFromByteBuffer

public static Object objectFromByteBuffer(InputStream bytes)
                                   throws Exception
Creates an object from a byte buffer using MarshalledValueInputStream.

Parameters:
bytes - serialized form of an object
Returns:
the object, or null if bytes is null
Throws:
Exception

objectToByteBuffer

public static byte[] objectToByteBuffer(Object obj)
                                 throws Exception
Serializes an object into a byte buffer using MarshalledValueOutputStream.

Parameters:
obj - an object that implements Serializable or Externalizable
Returns:
serialized form of the object
Throws:
Exception


Copyright © 2008 JBoss, a division of Red Hat. All Rights Reserved.