public final class StringPayload extends Object implements Payload, Serializable
| Constructor and Description |
|---|
StringPayload(String value,
MIMEType mimeType) |
StringPayload(String value,
MIMEType mimeType,
Charset charset) |
| Modifier and Type | Method and Description |
|---|---|
static StringPayload |
fromInputStream(InputStream is,
MIMEType mime) |
static StringPayload |
fromInputStream(InputStream is,
MIMEType mime,
Charset charset) |
Charset |
getCharset() |
InputStream |
getInputStream()
Returns the input stream of the payload.
|
MIMEType |
getMimeType()
Return the mime-type of the payload.
|
String |
getValue() |
boolean |
isAvailable()
Returns
true if the payload is available, IE. |
long |
length()
Returns the length of the stream.
|
public static StringPayload fromInputStream(InputStream is, MIMEType mime, Charset charset) throws IOException
IOExceptionpublic static StringPayload fromInputStream(InputStream is, MIMEType mime) throws IOException
IOExceptionpublic String getValue()
public Charset getCharset()
public MIMEType getMimeType()
PayloadgetMimeType in interface Payloadpublic 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.public 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.Copyright © 2008–2017. All rights reserved.