com.jkristian.io
Class URLEncodeOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by com.jkristian.io.URLEncodeOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable
Direct Known Subclasses:
URLEncodedOutputStream

public class URLEncodeOutputStream
extends java.io.FilterOutputStream

A filter that URL-encodes bytes that are 'unsafe' in the application/x-www-form-urlencoded content type. See http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4


Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
URLEncodeOutputStream(java.io.OutputStream out)
           
 
Method Summary
 void flush()
          Flush the output stream, unless setFlushOutput(false) was called most recently.
 void setFlushOutput(boolean flushOutput)
          Set whether to flush the output stream.
 void write(int b)
           
 
Methods inherited from class java.io.FilterOutputStream
close, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLEncodeOutputStream

public URLEncodeOutputStream(java.io.OutputStream out)
Method Detail

setFlushOutput

public void setFlushOutput(boolean flushOutput)
Set whether to flush the output stream. The default is true; that is, this.flush() will call out.flush() unless you call setFlushOutput(false). After setFlushOutput(false), you can flush preceding filters in a chain without flushing subsequent filters. For example, see FormEncodedOutput.


flush

public void flush()
           throws java.io.IOException
Flush the output stream, unless setFlushOutput(false) was called most recently.

Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.FilterOutputStream
Throws:
java.io.IOException

write

public void write(int b)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException