winstone
Class WinstoneResponseWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by winstone.WinstoneResponseWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class WinstoneResponseWriter
extends java.io.PrintWriter

A hacked print writer that allows us to trigger an automatic flush on println operations that go over the content length or buffer size. This is only necessary because the spec authors seem intent of having the print writer's flushing behaviour be half auto-flush and half not. Damned if I know why - seems unnecessary and confusing to me.

Version:
$Id: WinstoneResponseWriter.java,v 1.3 2006/02/28 07:32:47 rickknowles Exp $
Author:
Rick Knowles

Field Summary
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
WinstoneResponseWriter(WinstoneOutputStream out, WinstoneResponse response)
           
 
Method Summary
protected  void appendByteCount(java.lang.String input)
           
 void flush()
           
 void println()
           
protected  void simulateAutoFlush()
           
 void write(char[] buf, int off, int len)
           
 void write(int c)
           
 void write(java.lang.String s, int off, int len)
           
 
Methods inherited from class java.io.PrintWriter
append, append, append, checkError, clearError, close, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, setError, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WinstoneResponseWriter

public WinstoneResponseWriter(WinstoneOutputStream out,
                              WinstoneResponse response)
                       throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException
Method Detail

write

public void write(int c)
Overrides:
write in class java.io.PrintWriter

write

public void write(char[] buf,
                  int off,
                  int len)
Overrides:
write in class java.io.PrintWriter

write

public void write(java.lang.String s,
                  int off,
                  int len)
Overrides:
write in class java.io.PrintWriter

appendByteCount

protected void appendByteCount(java.lang.String input)

println

public void println()
Overrides:
println in class java.io.PrintWriter

flush

public void flush()
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.PrintWriter

simulateAutoFlush

protected void simulateAutoFlush()


Copyright © 2013. All Rights Reserved.