|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mule.util.compression.GZipCompression
public class GZipCompression
GZipCompression
is a CompressionStrategy implementation using the
GZip library included in the JDK java.util.zip. This is the default
CompressionStrategy used by the CompressionHelper discovery when no other
implementation is discovered.
Field Summary | |
---|---|
static int |
DEFAULT_BUFFER_SIZE
|
Fields inherited from interface org.mule.util.compression.CompressionStrategy |
---|
COMPRESSION_DEFAULT, SERVICE_ID |
Constructor Summary | |
---|---|
GZipCompression()
|
Method Summary | |
---|---|
byte[] |
compressByteArray(byte[] bytes)
Used for compressing a byte array into a new byte array using GZIP |
InputStream |
compressInputStream(InputStream is)
Compresses an InputStream . |
boolean |
isCompressed(byte[] bytes)
Determines if a byte array is compressed. |
byte[] |
uncompressByteArray(byte[] bytes)
Used for uncompressing a byte array into a uncompressed byte array using GZIP |
InputStream |
uncompressInputStream(InputStream is)
Uncompresses a compressed InputStream . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_BUFFER_SIZE
Constructor Detail |
---|
public GZipCompression()
Method Detail |
---|
public boolean isCompressed(byte[] bytes) throws IOException
isCompressed
in interface CompressionStrategy
bytes
- an array of bytes
IOException
- if the byte array couldn't be readpublic byte[] compressByteArray(byte[] bytes) throws IOException
compressByteArray
in interface CompressionStrategy
bytes
- An array of bytes to compress
IOException
- if it fails to write to a GZIPOutputStreamGZIPOutputStream
public InputStream compressInputStream(InputStream is) throws IOException
CompressionStrategy
InputStream
.
compressInputStream
in interface CompressionStrategy
is
- The InputStream
to compress.
InputStream
.
IOException
- If an I/O error has occurred.public byte[] uncompressByteArray(byte[] bytes) throws IOException
uncompressByteArray
in interface CompressionStrategy
bytes
- An array of bytes to uncompress
IOException
- if it fails to read from a GZIPInputStreamGZIPInputStream
public InputStream uncompressInputStream(InputStream is) throws IOException
CompressionStrategy
InputStream
.
uncompressInputStream
in interface CompressionStrategy
is
- The compressed InputStream
.
InputStream
.
IOException
- If an I/O error has occurred.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |