org.apache.tapestry.util.io
Class CompressedDataEncoder

java.lang.Object
  extended by org.apache.tapestry.util.io.CompressedDataEncoder

public class CompressedDataEncoder
extends Object

Utility class used by IRequestCycle to compress IdAllocator state.


Field Summary
static String BYTESTREAM_PREFIX
          Prefix on the MIME encoding that indicates that the encoded data is not encoded.
static String GZIP_BYTESTREAM_PREFIX
          Prefix on the MIME encoding that indicates that the encoded data is encoded with GZIP.
 
Method Summary
static String decodeString(String input)
          Takes a string with an encoded and compressed input as produced by encodeString(String) , and converts it back into the original String representation.
static String encodeString(String input)
          Encodes the given string into a compressed string representation that can later be decoded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BYTESTREAM_PREFIX

public static final String BYTESTREAM_PREFIX
Prefix on the MIME encoding that indicates that the encoded data is not encoded.

See Also:
Constant Field Values

GZIP_BYTESTREAM_PREFIX

public static final String GZIP_BYTESTREAM_PREFIX
Prefix on the MIME encoding that indicates that the encoded data is encoded with GZIP.

See Also:
Constant Field Values
Method Detail

encodeString

public static String encodeString(String input)
Encodes the given string into a compressed string representation that can later be decoded.

Parameters:
input - String input to compress and encode into a persistable form.
Returns:
encoded string (possibly empty, but not null)

decodeString

public static String decodeString(String input)
Takes a string with an encoded and compressed input as produced by encodeString(String) , and converts it back into the original String representation.

Parameters:
input - The data to un-encode, which should be equivalent to the same that was passed in to encodeString(String).
Returns:
The decoded string data.


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.