public final class RsWithBody extends RsWrap
This implementation of the Response
interface requires that
the Response.head()
method has to be invoked before reading
from the InputStream
obtained from the Response.body()
method.
The class is immutable and thread-safe.
Constructor and Description |
---|
RsWithBody(byte[] body)
Constructs a
RsWithBody with the specified body. |
RsWithBody(CharSequence body)
Constructs a
RsWithBody with the specified body that will be
encoded into UTF-8 by default. |
RsWithBody(InputStream body)
Constructs a
RsWithBody with the specified body. |
RsWithBody(Response res,
byte[] body)
Ctor.
|
RsWithBody(Response res,
CharSequence body)
Constructs a
RsWithBody with the specified response and body. |
RsWithBody(Response res,
CharSequence body,
Charset charset)
Constructs a
RsWithBody with the specified response and body. |
RsWithBody(Response res,
InputStream body)
Ctor.
|
RsWithBody(Response res,
URL url)
Ctor.
|
RsWithBody(URL url)
Constructs a
RsWithBody with the content located at the specified
url as body. |
public RsWithBody(CharSequence body)
RsWithBody
with the specified body that will be
encoded into UTF-8 by default.body
- Bodypublic RsWithBody(byte[] body)
RsWithBody
with the specified body.body
- Bodypublic RsWithBody(InputStream body)
RsWithBody
with the specified body.body
- Bodypublic RsWithBody(URL url)
RsWithBody
with the content located at the specified
url as body.url
- URL with bodypublic RsWithBody(Response res, CharSequence body)
RsWithBody
with the specified response and body. The
body will be encoded into UTF-8 by default.res
- Original responsebody
- Bodypublic RsWithBody(Response res, CharSequence body, Charset charset)
RsWithBody
with the specified response and body. The
body will be encoded using the specified character set.res
- Original responsebody
- Bodycharset
- The character set to use to serialize the bodypublic RsWithBody(Response res, URL url)
res
- Original responseurl
- URL with bodypublic RsWithBody(Response res, byte[] body)
res
- Original responsebody
- Bodypublic RsWithBody(Response res, InputStream body)
res
- Original responsebody
- BodyCopyright © 2015–2018 Take. All rights reserved.