sunlabs.brazil.server

Class Request.HttpOutputStream

public static class Request.HttpOutputStream extends 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
intbytesWritten
Count the number of bytes that are written to this stream
Constructor Summary
HttpOutputStream(OutputStream out)
Method Summary
voidsendHeaders(Request request)
voidwrite(byte b)
voidwrite(byte[] buf, int off, int len)
voidwriteBytes(String s)

Field Detail

bytesWritten

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

Constructor Detail

HttpOutputStream

public HttpOutputStream(OutputStream out)

Method Detail

sendHeaders

public void sendHeaders(Request request)

write

public void write(byte b)

write

public void write(byte[] buf, int off, int len)

writeBytes

public void writeBytes(String s)