|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.noderunner.http.ByteArrayDataPoster
public class ByteArrayDataPoster
A utility class for sending an array of bytes to an HTTP server or client. Example usage:
HttpClient client = new RetryHttpClient("http://example.net");
byte buf[] = "This is only a test".getBytes();
DataPoster dataPoster = new ByteArrayDataPoster(buf);
RequestLine rl = new RequestLineImpl( ... );
ClientRequest request = new ClientRequestImpl(rl, dataPoster);
client.writeRequest(request);
ClientResponse response = client.readResponse();
| Constructor Summary | |
|---|---|
ByteArrayDataPoster(byte[] data)
Constructs a ByteArrayDataPoster,
which will send an entire byte array. |
|
ByteArrayDataPoster(byte[] data,
int off,
int len)
Constructs a ByteArrayDataPoster
which will send part of a byte array. |
|
| Method Summary | |
|---|---|
void |
sendData(java.io.OutputStream os)
Writes the byte array to the supplied output stream. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ByteArrayDataPoster(byte[] data)
ByteArrayDataPoster,
which will send an entire byte array.
public ByteArrayDataPoster(byte[] data,
int off,
int len)
ByteArrayDataPoster
which will send part of a byte array.
data - source data arrayoff - zero-based offset in sourcelen - length of array to send| Method Detail |
|---|
public void sendData(java.io.OutputStream os)
throws java.io.IOException
sendData in interface DataPosteros - output stream to send data to
java.io.IOException - if data could not be writtenpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||