org.jboss.remoting.loading
Class CompressedClassBytes

java.lang.Object
  extended byorg.jboss.remoting.loading.ClassBytes (src) 
      extended byorg.jboss.remoting.loading.CompressedClassBytes
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class CompressedClassBytes
extends ClassBytes (src)
implements java.io.Externalizable

CompressedClassBytes is a ClassBytes subclass that compresses class data, if possible.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.remoting.loading.ClassBytes (src)
classBytes, className
 
Constructor Summary
CompressedClassBytes()
           
CompressedClassBytes(java.lang.String className, byte[] data, int compressionLevel)
           
 
Method Summary
 byte[] compress(byte[] input)
          Compresses the input data.
static void main(java.lang.String[] args)
           
 void readExternal(java.io.ObjectInput in)
           
 byte[] uncompress(byte[] input)
          Un-compresses the input data.
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class org.jboss.remoting.loading.ClassBytes (src)
getClassBytes, getClassName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompressedClassBytes

public CompressedClassBytes()

CompressedClassBytes

public CompressedClassBytes(java.lang.String className,
                            byte[] data,
                            int compressionLevel)
Method Detail

main

public static void main(java.lang.String[] args)

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

compress

public byte[] compress(byte[] input)
Compresses the input data.

Returns:
null if compression results in larger output.

uncompress

public byte[] uncompress(byte[] input)
                  throws java.io.IOException
Un-compresses the input data.

Throws:
java.io.IOException - if the input is not valid.