Package rocks.xmpp.extensions.compress
Interface CompressionMethod
-
public interface CompressionMethod
An interface to describe a compression method.
-
-
Field Summary
Fields Modifier and Type Field Description static CompressionMethod
DEFLATE
The "deflate" compression method.static CompressionMethod
GZIP
The "gzip" compression method.static CompressionMethod
ZLIB
The "zlib" compression method.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OutputStream
compress(OutputStream outputStream)
Gets the compressed output stream.InputStream
decompress(InputStream inputStream)
Decompresses an input stream.String
getName()
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.
-
-