Package dev.dsf.bpe.v2.service
Interface CompressionService
public interface CompressionService
-
Method Summary
Modifier and TypeMethodDescriptionfromBzip2
(InputStream in) fromGzip
(InputStream in) fromLzma2
(InputStream in) toBzip2
(InputStream in) Uses blockSize 9.toBzip2
(InputStream in, int blockSize) toGzip
(InputStream in) toLzma2
(InputStream in) Uses preset 6.toLzma2
(InputStream in, int preset) From XZ Java Library:
-
Method Details
-
toGzip
- Parameters:
in
- stream to compress, notnull
- Returns:
- gzip compressed stream
- Throws:
IOException
-
toBzip2
Uses blockSize 9.- Parameters:
in
- stream to compress, notnull
- Returns:
- bzip2 compressed stream
- Throws:
IOException
- if the stream content is malformed or an I/O error occurs- See Also:
-
toBzip2
- Parameters:
in
- stream to compress, notnull
blockSize
- 1-9 (100k units)- Returns:
- bzip2 compressed stream
- Throws:
IOException
- if the stream content is malformed or an I/O error occurs
-
toLzma2
Uses preset 6.- Parameters:
in
- stream to compress, notnull
- Returns:
- lzma2 compressed stream
- Throws:
IOException
- See Also:
-
toLzma2
From XZ Java Library:The presets 0-3 are fast presets with medium compression. The presets 4-6 are fairly slow presets with high compression. The default preset is 6.
The presets 7-9 are like the preset 6 but use bigger dictionaries and have higher compressor and decompressor memory requirements. Unless the uncompressed size of the file exceeds 8 MiB, 16 MiB, or 32 MiB, it is waste of memory to use the presets 7, 8, or 9, respectively.
- Parameters:
in
- stream to compress, notnull
preset
- 0-9- Returns:
- lzma2 compressed stream
- Throws:
IOException
-
fromGzip
- Parameters:
in
- gzip compressed stream, notnull
- Returns:
- uncompressed stream
- Throws:
IOException
-
fromBzip2
- Parameters:
in
- bzip2 compressed stream, notnull
- Returns:
- uncompressed stream
- Throws:
IOException
-
fromLzma2
- Parameters:
in
- lzma2 compressed stream, notnull
- Returns:
- uncompressed stream
- Throws:
IOException
-