Package sunlabs.brazil.server
Class Request.HttpOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- sunlabs.brazil.server.Request.HttpOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
- Enclosing class:
- Request
public static class Request.HttpOutputStream extends java.io.FilterOutputStream
TheHttpOutputStream
provides the convenience methodwriteBytes
for writing the byte representation of a string, without bringing in the overhead and the deprecated warnings associated with ajava.io.DataOutputStream
.The other methods in this class are here to allow the
FilterHandler
andChainSawHandler
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
Fields Modifier and Type Field Description int
bytesWritten
Count the number of bytes that are written to this stream
-
Constructor Summary
Constructors Constructor Description HttpOutputStream(java.io.OutputStream out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
sendHeaders(Request request)
void
write(byte b)
void
write(byte[] buf, int off, int len)
void
writeBytes(java.lang.String s)
-
-
-
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 classjava.io.FilterOutputStream
- Throws:
java.io.IOException
-
sendHeaders
public void sendHeaders(Request request) throws java.io.IOException
- Throws:
java.io.IOException
-
-