sunlabs.brazil.server
Class Request.HttpOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by sunlabs.brazil.server.Request.HttpOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable
Enclosing class:
Request

public static class Request.HttpOutputStream
extends java.io.FilterOutputStream

The HttpOutputStream provides the convenience method writeBytes for writing the byte representation of a string, without bringing in the overhead and the deprecated warnings associated with a java.io.DataOutputStream.

The other methods in this class are here to allow the FilterHandler and ChainSawHandler to alter the behavior in an implementation specific way. This behavior is unfortunate, and might go away when a better strategy comes along.


Field Summary
 int bytesWritten
          Count the number of bytes that are written to this stream
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
Request.HttpOutputStream(java.io.OutputStream out)
           
 
Method Summary
 void sendHeaders(Request request)
           
 void write(byte b)
           
 void write(byte[] buf, int off, int len)
           
 void writeBytes(java.lang.String s)
           
 
Methods inherited from class java.io.FilterOutputStream
close, flush, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bytesWritten

public int bytesWritten
Count the number of bytes that are written to this stream

Constructor Detail

Request.HttpOutputStream

public Request.HttpOutputStream(java.io.OutputStream out)
Method Detail

writeBytes

public void writeBytes(java.lang.String s)
                throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte b)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte[] buf,
                  int off,
                  int len)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

sendHeaders

public void sendHeaders(Request request)
                 throws java.io.IOException
Throws:
java.io.IOException