public class ResponseData
extends java.lang.Object
implements java.io.Closeable
Response
,
ResponseBody
Modifier and Type | Method and Description |
---|---|
byte[] |
bytes()
Returns the data from the source as a byte array
|
java.io.InputStream |
byteStream()
Returns an InputStream to read the data from the source
|
okio.ByteString |
byteString()
Reads and returns the content of the data as a ByteString object
|
void |
close()
|
long |
contentLength()
Returns the length of the content in the source
|
okio.BufferedSource |
source()
A BufferedSource which is the source of the data
|
void |
writeTo(okio.BufferedSink sink)
Writes all the data from the source into a BufferedSink
|
public java.io.InputStream byteStream()
public okio.BufferedSource source()
public okio.ByteString byteString() throws java.io.IOException
java.io.IOException
- on failed IO operationspublic byte[] bytes() throws java.io.IOException
java.io.IOException
- on failed IO operationspublic void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public long contentLength()
public void writeTo(okio.BufferedSink sink) throws java.io.IOException
sink
- The sink for the data to be written tojava.io.IOException
- on failed IO operations