org.mule.util.compression
Interface CompressionStrategy

All Known Implementing Classes:
GZipCompression

public interface CompressionStrategy

CompressionStrategy is a base interface for Different compression strategies


Field Summary
static String COMPRESSION_DEFAULT
          The fully qualified class name of the fallback CompressionStrategy implementation class to use, if no other can be found.
static String SERVICE_ID
          JDK1.3+ 'Service Provider' specification ( http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html )
 
Method Summary
 byte[] compressByteArray(byte[] bytes)
          Compresses a byte array.
 InputStream compressInputStream(InputStream is)
          Compresses an InputStream.
 boolean isCompressed(byte[] bytes)
          Checks whether a byte array has been compressed or not.
 byte[] uncompressByteArray(byte[] bytes)
          Uncompresses a compressed byte array.
 InputStream uncompressInputStream(InputStream is)
          Uncompresses a compressed InputStream.
 

Field Detail

COMPRESSION_DEFAULT

static final String COMPRESSION_DEFAULT
The fully qualified class name of the fallback CompressionStrategy implementation class to use, if no other can be found. the default is org.mule.util.compression.GZipCompression

See Also:
Constant Field Values

SERVICE_ID

static final String SERVICE_ID
JDK1.3+ 'Service Provider' specification ( http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html )

See Also:
Constant Field Values
Method Detail

compressByteArray

byte[] compressByteArray(byte[] bytes)
                         throws IOException
Compresses a byte array.

Parameters:
bytes - The byte array to compress.
Returns:
The compressed byte array.
Throws:
IOException - If an I/O error has occurred.

compressInputStream

InputStream compressInputStream(InputStream is)
                                throws IOException
Compresses an InputStream.

Parameters:
is - The InputStream to compress.
Returns:
The compressed InputStream.
Throws:
IOException - If an I/O error has occurred.

uncompressByteArray

byte[] uncompressByteArray(byte[] bytes)
                           throws IOException
Uncompresses a compressed byte array.

Parameters:
bytes - The byte array to uncompress.
Returns:
The uncompressed byte array.
Throws:
IOException - If an I/O error has occurred.

uncompressInputStream

InputStream uncompressInputStream(InputStream is)
                                  throws IOException
Uncompresses a compressed InputStream.

Parameters:
is - The compressed InputStream.
Returns:
The uncompressed InputStream.
Throws:
IOException - If an I/O error has occurred.

isCompressed

boolean isCompressed(byte[] bytes)
                     throws IOException
Checks whether a byte array has been compressed or not.

Parameters:
bytes - The byte array.
Returns:
True if the byte array is compressed, false otherwise.
Throws:
IOException - If an I/O error has occurred.


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.