View Javadoc

1   /*
2    * $Id: CompressionStrategy.java 7976 2007-08-21 14:26:13Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.util.compression;
12  
13  import java.io.IOException;
14  
15  /**
16   * <code>CompressionStrategy</code> is a base interface for Different compression
17   * strategies
18   * 
19   * @author <a href="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
20   * @version $Revision: 7976 $
21   */
22  public interface CompressionStrategy
23  {
24      /**
25       * The fully qualified class name of the fallback
26       * <code>CompressionStrategy</code> implementation class to use, if no other
27       * can be found. the default is
28       * <code>org.mule.util.compression.GZipCompression</code>
29       */
30      String COMPRESSION_DEFAULT = "org.mule.util.compression.GZipCompression";
31  
32      /**
33       * JDK1.3+ 'Service Provider' specification (
34       * http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html )
35       */
36      String SERVICE_ID = "META-INF/services/org.mule.util.compression.CompressionStrategy";
37  
38      byte[] compressByteArray(byte[] bytes) throws IOException;
39  
40      byte[] uncompressByteArray(byte[] bytes) throws IOException;
41  
42      boolean isCompressed(byte[] bytes) throws IOException;
43  }