public final class ResponseBytes<ResponseT> extends Object
getObjectBytes
. Can also be retrieved by passing
ResponseTransformer.toBytes()
or AsyncResponseTransformer.toBytes()
to a streaming output operation.Modifier and Type | Method and Description |
---|---|
byte[] |
asByteArray() |
ByteBuffer |
asByteBuffer() |
InputStream |
asInputStream() |
String |
asString(Charset charset)
Retrieve the output as a string.
|
String |
asUtf8String() |
boolean |
equals(Object o) |
static <ResponseT> |
fromByteArray(ResponseT response,
byte[] bytes) |
int |
hashCode() |
ResponseT |
response() |
String |
toString() |
public static <ResponseT> ResponseBytes<ResponseT> fromByteArray(ResponseT response, byte[] bytes)
public ResponseT response()
public boolean equals(Object o)
public int hashCode()
public final ByteBuffer asByteBuffer()
public final byte[] asByteArray()
to prevent creating an additional array copy.
public final String asString(Charset charset) throws UncheckedIOException
charset
- The charset of the string.UncheckedIOException
- with a CharacterCodingException
as the cause if the bytes cannot be encoded using the
provided charsetpublic final String asUtf8String() throws UncheckedIOException
UncheckedIOException
- with a CharacterCodingException
as the cause if the bytes cannot be encoded as UTF-8.public final InputStream asInputStream()
Copyright © 2018. All rights reserved.