mx4j.adaptor.http
Class HttpOutputStream
java.lang.Object
|
+--java.io.OutputStream
|
+--java.io.FilterOutputStream
|
+--java.io.BufferedOutputStream
|
+--mx4j.adaptor.http.HttpOutputStream
- public class HttpOutputStream
- extends java.io.BufferedOutputStream
HttpAdaptor sets the basic adaptor listening for HTTP requests
- Version:
- $Revision: 1.4 $
- Author:
- Carlos Quiroz
Field Summary |
protected int |
code
Answer code |
protected java.util.Map |
headers
Headers to be sent |
protected boolean |
sendHeaders
whether to send the headers |
Fields inherited from class java.io.BufferedOutputStream |
buf, count |
Fields inherited from class java.io.FilterOutputStream |
out |
Constructor Summary |
HttpOutputStream(java.io.OutputStream out,
HttpInputStream in)
Creates a new HttpOutputStream with a given OutputStream and an InputStream |
Method Summary |
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 |
Methods inherited from class java.io.BufferedOutputStream |
flush, write, write |
Methods inherited from class java.io.FilterOutputStream |
close, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
code
protected int code
- Answer code
sendHeaders
protected boolean sendHeaders
- whether to send the headers
headers
protected java.util.Map headers
- Headers to be sent
HttpOutputStream
public HttpOutputStream(java.io.OutputStream out,
HttpInputStream in)
- Creates a new HttpOutputStream with a given OutputStream and an InputStream
- Parameters:
out
- The OutputStream normally associated with the output socket
stream of the incoming connectionin
- HttpInputStream containing the incoming request
setCode
public void setCode(int code)
- Sets the answer code
- Parameters:
code
- The new code value
setHeader
public void setHeader(java.lang.String attr,
java.lang.String value)
- Sets a given header code
- Parameters:
attr
- The new header namevalue
- The new header value
sendHeaders
public boolean sendHeaders()
throws java.io.IOException
- Sends the headers
- Returns:
- Description of the Returned Value
- Throws:
java.io.IOException
- Description of Exception
write
public void write(java.lang.String msg)
throws java.io.IOException
- Writes a given message line
- Parameters:
msg
- The message to be written- Throws:
java.io.IOException
-
write
public void write(java.io.InputStream in)
throws java.io.IOException
- Writes the content of the input stream to the output stream
- Parameters:
in
- The input stream- Throws:
java.io.IOException
-
Copyright © 2001-2002 MX4J Team. All Rights Reserved.