commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
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:
https://wiki.apache.org/commons/Compress?action=diff&rev1=8&rev2=9

Comment:
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",
out);
  	IOUtils.copy(new FileInputStream(input), cos);
  	cos.close();}}}
  
  === Decompressing a file ===
- 	{{{final InputStream is = new FileInputStream(input);
+ 	{{{final InputStream is = new BufferedInputStream(new FileInputStream(input));
          CompressorInputStream in = new CompressorStreamFactory().createCompressorInputStream("bzip2",
is);
          IOUtils.copy(in, new FileOutputStream(output));
  	in.close();}}}

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message