> -----Original Message-----
> From: Stefan Bodewig [mailto:[EMAIL PROTECTED]

> On Tue, 11 Dec 2001, Stephane Bailliez <[EMAIL PROTECTED]>
> wrote:
> 
> > It calls flush of the wrapped stream if there is any '\n'
> > encountered in what is being written.
> 
> This is what the documentation of flush says, the rest has not been
> that clear to me.  Anyway, I've changed the class and remove the
> printlnAndFlush method.

I'm always looking at the source code to be sure :)

Sample from PrintStream...they are all using the same logic

    private void write(String s) {
        try {
            synchronized (this) {
                ensureOpen();
                textOut.write(s);
                textOut.flushBuffer();
                charOut.flushBuffer();
                if (autoFlush && (s.indexOf('\n') >= 0))
                    out.flush();
            }
        }
        catch (InterruptedIOException x) {
            Thread.currentThread().interrupt();
        }
        catch (IOException x) {
            trouble = true;
        }
    }

Stephane

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to