mx4j.tools.adaptor.http
Class HttpOutputStream
BufferedOutputStream
mx4j.tools.adaptor.http.HttpOutputStream
public class HttpOutputStream
extends BufferedOutputStream
HttpAdaptor sets the basic adaptor listening for HTTP requests
protected int | code - Answer code
|
protected Map | headers - Headers to be sent
|
protected boolean | sendHeaders - whether to send the headers
|
boolean | sendHeaders() - Sends the headers
|
void | setCode(int code) - Sets the answer code
|
void | setHeader(String attr, String value) - Sets a given header code
|
void | write(InputStream in) - Writes the content of the input stream to the output stream
|
void | write(String msg) - Writes a given message line
|
code
protected int code
Answer code
headers
protected Map headers
Headers to be sent
sendHeaders
protected boolean sendHeaders
whether to send the headers
HttpOutputStream
public HttpOutputStream(OutputStream out,
HttpInputStream in)
Creates a new HttpOutputStream with a given OutputStream and an InputStream
out
- The OutputStream normally associated with the output socket
stream of the incoming connectionin
- HttpInputStream containing the incoming request
sendHeaders
public boolean sendHeaders()
throws IOException
Sends the headers
- Description of the Returned Value
setCode
public void setCode(int code)
Sets the answer code
code
- The new code value
setHeader
public void setHeader(String attr,
String value)
Sets a given header code
attr
- The new header namevalue
- The new header value
write
public void write(InputStream in)
throws IOException
Writes the content of the input stream to the output stream
write
public void write(String msg)
throws IOException
Writes a given message line
msg
- The message to be written
Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.