org.basex.util
Class Compress

java.lang.Object
  extended by org.basex.util.Compress

public final class Compress
extends java.lang.Object

This class compresses and decompresses tokens. It is inspired by the Huffman coding, but was simplified to speed up processing. NOTE: this class is not thread-safe.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen, Wolfgang Kronberg

Constructor Summary
Compress()
           
 
Method Summary
 byte[] pack(byte[] txt)
          Compresses the specified text.
 byte[] unpack(byte[] txt)
          Decompresses the specified text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Compress

public Compress()
Method Detail

pack

public byte[] pack(byte[] txt)
Compresses the specified text.

Parameters:
txt - text to be packed
Returns:
packed text

unpack

public byte[] unpack(byte[] txt)
Decompresses the specified text.

Parameters:
txt - text to be unpacked
Returns:
unpacked text