Package rocks.xmpp.extensions.compress
Interface CompressionMethod
-
public interface CompressionMethodAn interface to describe a compression method.
-
-
Field Summary
Fields Modifier and Type Field Description static CompressionMethodDEFLATEThe "deflate" compression method.static CompressionMethodGZIPThe "gzip" compression method.static CompressionMethodZLIBThe "zlib" compression method.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OutputStreamcompress(OutputStream outputStream)Gets the compressed output stream.InputStreamdecompress(InputStream inputStream)Decompresses an input stream.StringgetName()Gets the compression method name, e.g.
-
-
-
Field Detail
-
ZLIB
static final CompressionMethod ZLIB
The "zlib" compression method.
-
GZIP
static final CompressionMethod GZIP
The "gzip" compression method.
-
DEFLATE
static final CompressionMethod DEFLATE
The "deflate" compression method.
-
-
Method Detail
-
getName
String getName()
Gets the compression method name, e.g. "zlib", "lzw", "exi", ...- Returns:
- The compression method name.
-
decompress
InputStream decompress(InputStream inputStream) throws IOException
Decompresses an input stream.- Parameters:
inputStream- The compressed input stream.- Returns:
- The decompressed input stream.
- Throws:
IOException- If the decompression failed.
-
compress
OutputStream compress(OutputStream outputStream) throws IOException
Gets the compressed output stream.- Parameters:
outputStream- The uncompressed output stream.- Returns:
- The compressed output stream.
- Throws:
IOException- If the compression failed.
-
-