public class WebResponseData extends Object implements Serializable
| Modifier | Constructor and Description |
|---|---|
|
WebResponseData(byte[] body,
int statusCode,
String statusMessage,
List responseHeaders)
Construct with a raw byte[] (mostly for testing)
|
|
WebResponseData(InputStream bodyStream,
int statusCode,
String statusMessage,
List responseHeaders)
Construct with a data stream to minimize copying of the entire body.
|
protected |
WebResponseData(int statusCode,
String statusMessage,
List responseHeaders)
Construct without data stream for subclasses that override getBody()
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBody()
Return the response body.
|
protected byte[] |
getBody(InputStream stream,
List headers)
Returns the body byte array contained by the specified input stream.
|
List |
getResponseHeaders() |
int |
getStatusCode() |
String |
getStatusMessage() |
public WebResponseData(byte[] body,
int statusCode,
String statusMessage,
List responseHeaders)
body - Body of this responsestatusCode - Status code from the serverstatusMessage - Status message from the serverresponseHeaders - Headers in this responsepublic WebResponseData(InputStream bodyStream, int statusCode, String statusMessage, List responseHeaders) throws IOException
bodyStream - Stream of this response's bodystatusCode - Status code from the serverstatusMessage - Status message from the serverresponseHeaders - Headers in this responseIOException - on stream errorsprotected WebResponseData(int statusCode,
String statusMessage,
List responseHeaders)
throws IOException
statusCode - Status code from the serverstatusMessage - Status message from the serverresponseHeaders - Headers in this responseIOException - on stream errorsprotected byte[] getBody(InputStream stream, List headers) throws IOException
stream - The input stream which contains the body.headers - The response headers.IOException - If a stream error occurs.public byte[] getBody()
public List getResponseHeaders()
public int getStatusCode()
public String getStatusMessage()
Copyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.