commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Commons Wiki] Update of "Compress" by StefanBodewig
Date Sat, 04 Feb 2017 16:17:56 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Commons Wiki" for change notification.

The "Compress" page has been changed by StefanBodewig:

COMPRESS-381 - improve performance by buffering

  Same goes for Compressor. Compressor streams are: bz2, gz, lzma, xz, pack200, Z.
  === Compressing a file ===
- 	{{{final OutputStream out = new FileOutputStream(output);
+ 	{{{final OutputStream out = new BufferedOutputStream(new FileOutputStream(output));
  	CompressorOutputStream cos = new CompressorStreamFactory().createCompressorOutputStream("bzip2",
  	IOUtils.copy(new FileInputStream(input), cos);
  === Decompressing a file ===
- 	{{{final InputStream is = new FileInputStream(input);
+ 	{{{final InputStream is = new BufferedInputStream(new FileInputStream(input));
          CompressorInputStream in = new CompressorStreamFactory().createCompressorInputStream("bzip2",
          IOUtils.copy(in, new FileOutputStream(output));

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message