Permalink
Browse files

Merge pull request #573 from aviflax/patch-1

Added guidance on flushing to a method doc comment
  • Loading branch information...
2 parents 3ac4631 + 6e6942f commit 7beac7041ac7e0aa5d01a25aea18692a656a1a9a @jlouvel jlouvel committed Apr 25, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 modules/org.restlet/src/org/restlet/representation/Representation.java
@@ -669,7 +669,10 @@ public abstract void write(
* <br>
* Note that the class implementing this method shouldn't flush or close the
* given {@link OutputStream} after writing to it as this will be handled by
- * the Restlet connectors automatically.
+ * the Restlet connectors automatically. However, if outputStream is wrapped
+ * with an object which is {@link java.io.Flushable} such as a
+ * {@link java.io.OutputStreamWriter} make sure the wrapping object is
+ * flushed before the method returns.
*
* @param outputStream
* The output stream.

0 comments on commit 7beac70

Please sign in to comment.