You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2018/06/25 17:13:34 UTC

svn commit: r1834349 - in /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox: pdfwriter/COSWriter.java pdmodel/PDDocument.java

Author: tilman
Date: Mon Jun 25 17:13:34 2018
New Revision: 1834349

URL: http://svn.apache.org/viewvc?rev=1834349&view=rev
Log:
PDFBOX-4241: clarify in javadoc that output stream will be closed

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java?rev=1834349&r1=1834348&r2=1834349&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java Mon Jun 25 17:13:34 2018
@@ -216,9 +216,10 @@ public class COSWriter implements ICOSVi
     private COSArray byteRangeArray;
 
     /**
-     * COSWriter constructor comment.
+     * COSWriter constructor.
      *
-     * @param outputStream The wrapped output stream.
+     * @param outputStream The output stream to write the PDF. It will be closed when this object is
+     * closed.
      */
     public COSWriter(OutputStream outputStream)
     {
@@ -227,11 +228,12 @@ public class COSWriter implements ICOSVi
     }
 
     /**
-     * COSWriter constructor for incremental updates. 
+     * COSWriter constructor for incremental updates.
      *
-     * @param outputStream output stream where the new PDF data will be written
+     * @param outputStream output stream where the new PDF data will be written. It will be closed
+     * when this object is closed.
      * @param inputData random access read containing source PDF data
-     * 
+     *
      * @throws IOException if something went wrong
      */
     public COSWriter(OutputStream outputStream, RandomAccessRead inputData) throws IOException

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java?rev=1834349&r1=1834348&r2=1834349&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java Mon Jun 25 17:13:34 2018
@@ -1232,9 +1232,9 @@ public class PDDocument implements Close
 
     /**
      * This will save the document to an output stream.
-     * 
-     * @param output The stream to write to. It is recommended to wrap it in a
-     * {@link java.io.BufferedOutputStream}, unless it is already buffered.
+     *
+     * @param output The stream to write to. It will be closed when done. It is recommended to wrap
+     * it in a {@link java.io.BufferedOutputStream}, unless it is already buffered.
      *
      * @throws IOException if the output could not be written
      */
@@ -1263,7 +1263,8 @@ public class PDDocument implements Close
      * Save the PDF as an incremental update. This is only possible if the PDF was loaded from a
      * file or a stream, not if the document was created in PDFBox itself.
      *
-     * @param output stream to write. It should <i><b>not</b></i> point to the source file.
+     * @param output stream to write to. It will be closed when done. It should <i><b>not</b></i>
+     * point to the source file.
      * @throws IOException if the output could not be written
      * @throws IllegalStateException if the document was not loaded from a file or a stream.
      */
@@ -1307,7 +1308,8 @@ public class PDDocument implements Close
      * {@code PDDocument} instance and only AFTER {@link ExternalSigningSupport} instance is used.
      * </p>
      *
-     * @param output stream to write final PDF. It should <i><b>not</b></i> point to the source file.
+     * @param output stream to write the final PDF. It should <i><b>not</b></i> point to the source
+     * file. It will be closed when the document is closed.
      * @return instance to be used for external signing and setting CMS signature
      * @throws IOException if the output could not be written
      * @throws IllegalStateException if the document was not loaded from a file or a stream or