public interface XmlRpcClientConnection
The methods in this interface must be called in the following order:
setOutputContentLength
,
setKeepAlive
, setGzip
getOutputStream
getInputStream
getInputContentLength
,
isServerKeepAlive
,
isInputGzipped
close
If isServerKeepAlive
returns true
then
the caller can go back to the start rather than calling
close
Modifier and Type | Method and Description |
---|---|
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.
|
void setOutputContentLength(int contentLength)
contentLength
- the number of bytes that will be writtenvoid setKeepAlive(boolean keepAlive)
keepAlive
- true, to make the connection persistentvoid setGzip(boolean gzip)
gzip
- true to gzip!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 writtenjava.io.IOException
- for the same reasons, any Stream causes
an IOException
java.io.InputStream getInputStream() throws java.io.IOException
InputStream from which the result can be read.
java.io.IOException
- for the same reasons, any Stream causes
an IOException
int getInputContentLength()
boolean isServerKeepAlive()
getOutputStream
may be called again, otherwise
close
must be called.boolean isInputGzipped()
void close() throws java.io.IOException
java.io.IOException
- in case of an IO Error.