|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A connection from a client to a server.
The methods in this interface must be called in the following order:
setOutputContentLength,
setKeepAlive, setGzipgetOutputStreamgetInputStreamgetInputContentLength,
isServerKeepAlive,
isInputGzippedcloseIf isServerKeepAlive returns true then
the caller can go back to the start rather than calling
close
| Method Summary | |
void |
close()
Closes the connection to the server. |
int |
getInputContentLength()
|
java.io.InputStream |
getInputStream()
|
java.io.OutputStream |
getOutputStream()
Returns an OutputStream on which the request can
be written. |
boolean |
isInputGzipped()
|
boolean |
isServerKeepAlive()
|
void |
setGzip(boolean gzip)
Sets whether or not the server should be informed that the request will be gzip encoded. |
void |
setKeepAlive(boolean keepAlive)
Sets whether or not the server will be asked to make the connection persistent. |
void |
setOutputContentLength(int contentLength)
Sets the number of bytes that will be written, i.e. |
| Method Detail |
public void setOutputContentLength(int contentLength)
contentLength - the number of bytes that will be writtenpublic void setKeepAlive(boolean keepAlive)
keepAlive - true, to make the connection persistentpublic void setGzip(boolean gzip)
gzip - true to gzip!
public java.io.OutputStream getOutputStream()
throws java.io.IOException
OutputStream on which the request can
be written. The request should be completely written and the
OutputStream closed before calling
getInputStream.
OutputStream on which the request can
be written
java.io.IOException - for the same reasons, any Stream causes
an IOException
public java.io.InputStream getInputStream()
throws java.io.IOException
InputStream from which the result can be read.
- Throws:
java.io.IOException - for the same reasons, any Stream causes
an IOExceptionpublic int getInputContentLength()
public boolean isServerKeepAlive()
getOutputStream may be called again, otherwise
close must be called.public boolean isInputGzipped()
public void close()
throws java.io.IOException
java.io.IOException - in case of an IO Error.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||