title: PrintWriter autoflush puzzling logic
body: <p><a href="http://download.oracle.com/javase/6/docs/api/java/io/PrintWriter.html#PrintWriter%28java.io.OutputStream,%20boolean%29" rel="nofollow noreferrer">public PrintWriter(OutputStream out, boolean autoFlush)</a>:</p>
  <blockquote>
  <pre><code>out - An output stream
  autoFlush - A boolean; if true, the println, printf, or format methods
  will flush the output buffer
  </code></pre>
  </blockquote>
  <p><a href="http://download.oracle.com/javase/6/docs/api/java/io/PrintStream.html#PrintStream%28java.io.OutputStream,%20boolean%29" rel="nofollow noreferrer">public PrintStream(OutputStream out, boolean autoFlush)</a>:</p>
  <blockquote>
  <pre><code>out - The output stream to which values and objects will be printed 
  autoFlush - A boolean; if true, the output buffer will be flushed 
  whenever a byte array is written, one of the println methods is invoked, 
  or a newline character or byte ('\n') is written
  </code></pre>
  </blockquote>
  <h3>What was the reason for changing autoflush logic between these classes?</h3>
  <p>Because they are always considered as identical except for encoding moments and &quot;autoflush&quot; without flushing on <code>print()</code> hardly corresponds to principle of least astonishment, silly bugs occur:<br />
  <a href="https://stackoverflow.com/questions/1240968/i-created-a-printwriter-with-autoflush-on-why-isnt-it-autoflushing">I created a PrintWriter with autoflush on; why isn&#39;t it autoflushing?</a></p>