public class InputStreamPayload extends Object implements Payload
| Constructor and Description |
|---|
InputStreamPayload(InputStream stream,
MIMEType mimeType) |
InputStreamPayload(InputStream stream,
MIMEType mimeType,
long length)
Constructs an Inputstream payload.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getInputStream()
Returns the input stream of the payload.
|
MIMEType |
getMimeType()
Return the mime-type of the payload.
|
boolean |
isAvailable()
Returns
true if the payload is available, IE. |
long |
length()
Returns the length of the stream.
|
public InputStreamPayload(InputStream stream, MIMEType mimeType)
public InputStreamPayload(InputStream stream, MIMEType mimeType, long length)
stream - the stream to create the payload from; may not be nullmimeType - the mime type of the stream. Defaults to
application/octet-stream if not set.public MIMEType getMimeType()
PayloadgetMimeType in interface Payloadpublic boolean isAvailable()
Payloadtrue if the payload is available, IE. If the stream can be read from.isAvailable in interface Payloadtrue if the payload is available. false if not.public InputStream getInputStream()
PayloadgetInputStream in interface Payloadnull if the payload is not available.public long length()
PayloadHTTPResponse,
this is the value of the Content-Length header. If the payload is used in a request, it can be set,
or calculated based on the type.Copyright © 2008-2013. All Rights Reserved.