public abstract class ResponseBody
extends java.lang.Object
implements java.io.Closeable
Response,
ResponseData,
ProtocolReader| Constructor and Description |
|---|
ResponseBody() |
| Modifier and Type | Method and Description |
|---|---|
abstract long |
contentLength()
Returns the length of the content in this ResponseBody
|
abstract ResponseData
|
data()
Returns the ResponseData for this ResponseBody
|
abstract Endpoint |
endpoint()
Returns the source Endpoint for this
ResponseBody
|
abstract ProtocolReader
|
reader()
Returns the ProtocolReader
which is able to read this ResponseBody
|
java.lang.String |
toString()
|
java.util.Map<java.lang.String,?> |
toValues()
Reads the data from the RequestBody and constructs a Map with all the data
|
byte[] |
valuesByteArray()
Deprecated.
See valuesBytes()
|
okio.ByteString |
valuesBytes()
Deprecated.
The one-shot stream of data being held by a ResponseBody
needs to be decoded by a ProtocolReader which is already configured
and ready for reading. The method brings some behavior ambiguity in cases where
the stream may be partially consumed through the exposed ProtocolReader.
|
abstract void |
writeTo(okio.BufferedSink sink)
Deprecated.
The one-shot stream of data being held by a ResponseBody
needs to be decoded by a ProtocolReader which is already configured
and ready for reading. The method brings some behavior ambiguity in cases where
the stream may be partially consumed through the exposed ProtocolReader.
*
|
public abstract ProtocolReader reader()
@Deprecated
public okio.ByteString valuesBytes()
throws java.io.IOException
Note that the method will read an entire response body in memory, which potentially may cause an OutOfMemoryError
java.io.IOException - on failed IO operationsjava.lang.IllegalStateException - if the response is already partially read
* through the exposed ProtocolReader.
@Deprecated
public final byte[] valuesByteArray()
throws java.io.IOException
Note that the method will read an entire response body in memory, which potentially may cause an OutOfMemoryError
java.io.IOException - on failed IO operationspublic final java.util.Map<java.lang.String,?> toValues()
throws java.io.IOException
java.io.IOException - on failed IO operationspublic abstract long contentLength()
public abstract ResponseData data() throws java.io.IOException
java.io.IOException - on failed IO operationspublic abstract Endpoint endpoint()
@Deprecated
public abstract void writeTo(okio.BufferedSink sink)
throws java.io.IOException
sink - the receiver of the datajava.io.IOException - on failed IO operationsjava.lang.IllegalStateException - if the response is already partially read
through the exposed ProtocolReader.
public java.lang.String toString()
toString in class java.lang.Object