org.jboss.cache.marshall
Class MarshallUtil

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

public class MarshallUtil
extends java.lang.Object

Utility methods related to marshalling and unmarshalling objects.

Version:
$Revision$
Author:
Brian Stansberry

Constructor Summary
MarshallUtil()
           
 
Method Summary
static java.lang.Object objectFromByteBuffer(byte[] bytes)
          Creates an object from a byte buffer using MarshalledValueInputStream.
static java.lang.Object objectFromByteBuffer(java.io.InputStream bytes)
          Creates an object from a byte buffer using MarshalledValueInputStream.
static byte[] objectToByteBuffer(java.lang.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 java.lang.Object objectFromByteBuffer(byte[] bytes)
                                             throws java.lang.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:
java.lang.Exception

objectFromByteBuffer

public static java.lang.Object objectFromByteBuffer(java.io.InputStream bytes)
                                             throws java.lang.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:
java.lang.Exception

objectToByteBuffer

public static byte[] objectToByteBuffer(java.lang.Object obj)
                                 throws java.lang.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:
java.lang.Exception


Copyright © 1998-2005 JBoss Inc . All Rights Reserved.