commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grobme...@apache.org
Subject svn commit: r764674 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
Date Tue, 14 Apr 2009 04:56:42 GMT
Author: grobmeier
Date: Tue Apr 14 04:56:41 2009
New Revision: 764674

URL: http://svn.apache.org/viewvc?rev=764674&view=rev
Log:
added examples to javadoc

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java?rev=764674&r1=764673&r2=764674&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
Tue Apr 14 04:56:41 2009
@@ -28,11 +28,29 @@
 import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream;
 
 /**
- * Factory to create Compressor[In|Out]putStreams from names In order add other
+ * <p>Factory to create Compressor[In|Out]putStreams from names. To add other
  * implementations you should extend CompressorStreamFactory and override the
- * appropriate methods (and call their implementation from super of course)
+ * appropriate methods (and call their implementation from super of course).</p>
+ * 
+ * Example (Compressing a file):
+ * 
+ * <pre>
+ * final OutputStream out = new FileOutputStream(output); 
+ * CompressorOutputStream cos = 
+ *      new CompressorStreamFactory().createCompressorOutputStream("bzip2", out);
+ * IOUtils.copy(new FileInputStream(input), cos);
+ * cos.close();
+ * </pre>    
+ * 
+ * Example (Compressing a file):
+ * <pre>
+ * final InputStream is = new FileInputStream(input); 
+ * CompressorInputStream in = 
+ *      new CompressorStreamFactory().createCompressorInputStream("bzip2", is);
+ * IOUtils.copy(in, new FileOutputStream(output));
+ * in.close();
+ * </pre>
  * 
- * TODO add example here
  * @Immutable
  */
 public class CompressorStreamFactory {



Mime
View raw message