org.jboss.remoting.marshal.compress
Class CompressingUnMarshaller

java.lang.Object
  extended by org.jboss.remoting.marshal.serializable.SerializableUnMarshaller
      extended by org.jboss.remoting.marshal.compress.CompressingUnMarshaller
All Implemented Interfaces:
java.io.Serializable, PreferredStreamUnMarshaller, SerialUnMarshaller, UnMarshaller, VersionedUnMarshaller

public class CompressingUnMarshaller
extends SerializableUnMarshaller

CompressingMarshaller and CompressingUnMarshaller are a general purpose compressing marshaller / decompressing unmarshaller pair based on Java's GZIP facilities.

CompressingUnMarshaller is subclassed from SerializableUnMarshaller, and by default it uses super.read() to deserialize an object, once the object has been uncompressed. Optionally, it can wrap any other unmarshaller and use that instead of SerializableUnMarshaller to unmarshall an uncompressed input stream. For example,

new CompressingUnMarshaller(new HTTPUnMarshaller())
will create an umarshaller that uses an HTTPUnMarshaller to restore an uncompressed input stream.

Version:
$Revision: 2385 $

Copyright (c) 2005

Author:
Ron Sigal
See Also:
Serialized Form

Field Summary
static java.lang.String DATATYPE
           
 
Fields inherited from class org.jboss.remoting.marshal.serializable.SerializableUnMarshaller
customClassLoader, serializationType
 
Constructor Summary
CompressingUnMarshaller()
          Create a new CompressingUnMarshaller.
CompressingUnMarshaller(UnMarshaller unMarshaller)
          Create a new CompressingUnMarshaller.
 
Method Summary
 UnMarshaller cloneUnMarshaller()
          Returns a new CompressingUnMarshaller
 java.lang.Object read(java.io.InputStream inputStream, java.util.Map metadata, int version)
          Restores a compressed, marshalled form of an object to its original state.
 
Methods inherited from class org.jboss.remoting.marshal.serializable.SerializableUnMarshaller
getMarshallingStream, getMarshallingStream, getSerializationType, read, setClassLoader, setSerializationType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATATYPE

public static final java.lang.String DATATYPE
See Also:
Constant Field Values
Constructor Detail

CompressingUnMarshaller

public CompressingUnMarshaller()
Create a new CompressingUnMarshaller.


CompressingUnMarshaller

public CompressingUnMarshaller(UnMarshaller unMarshaller)
Create a new CompressingUnMarshaller.

Parameters:
unMarshaller - unmarshaller to be used to restore uncompressed byte stream to original object
Method Detail

read

public java.lang.Object read(java.io.InputStream inputStream,
                             java.util.Map metadata,
                             int version)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException
Restores a compressed, marshalled form of an object to its original state.

Specified by:
read in interface VersionedUnMarshaller
Overrides:
read in class SerializableUnMarshaller
Parameters:
inputStream - InputStream from which marshalled form is to be retrieved
metadata - can be any transport specific metadata (such as headers from http transport). This can be null, depending on if transport supports metadata.
version - wire format version
Returns:
restored object
Throws:
java.io.IOException - if there is a problem reading from inputStream
java.lang.ClassNotFoundException - if there is a problem finding a class needed for unmarshalling

cloneUnMarshaller

public UnMarshaller cloneUnMarshaller()
                               throws java.lang.CloneNotSupportedException
Returns a new CompressingUnMarshaller

Specified by:
cloneUnMarshaller in interface UnMarshaller
Overrides:
cloneUnMarshaller in class SerializableUnMarshaller
Returns:
a new CompressingUnMarshaller
Throws:
java.lang.CloneNotSupportedException - In practice no exceptions are thrown.


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