public class HttpOutputStream
extends java.io.BufferedOutputStream
Modifier and Type | Field and Description |
---|---|
protected int |
code
Answer code
|
protected java.util.Map |
headers
Headers to be sent
|
protected boolean |
sendHeaders
whether to send the headers
|
Constructor and Description |
---|
HttpOutputStream(java.io.OutputStream out,
HttpInputStream in)
Creates a new HttpOutputStream with a given OutputStream and an InputStream
|
Modifier and Type | Method and Description |
---|---|
boolean |
sendHeaders()
Sends the headers
|
void |
setCode(int code)
Sets the answer code
|
void |
setHeader(java.lang.String attr,
java.lang.String value)
Sets a given header code
|
void |
write(java.io.InputStream in)
Writes the content of the input stream to the output stream
|
void |
write(java.lang.String msg)
Writes a given message line
|
protected int code
protected boolean sendHeaders
protected java.util.Map headers
public HttpOutputStream(java.io.OutputStream out, HttpInputStream in)
out
- The OutputStream normally associated with the output socket
stream of the incoming connectionin
- HttpInputStream containing the incoming requestpublic void setCode(int code)
code
- The new code valuepublic void setHeader(java.lang.String attr, java.lang.String value)
attr
- The new header namevalue
- The new header valuepublic boolean sendHeaders() throws java.io.IOException
java.io.IOException
- Description of Exceptionpublic void write(java.lang.String msg) throws java.io.IOException
msg
- The message to be writtenjava.io.IOException
public void write(java.io.InputStream in) throws java.io.IOException
in
- The input streamjava.io.IOException