public abstract class ResponseBody
extends java.lang.Object
implements java.io.Closeable
Constructor and Description |
---|
ResponseBody() |
Modifier and Type | Method and Description |
---|---|
byte[] |
bytes() |
java.io.InputStream |
byteStream() |
java.io.Reader |
charStream()
Returns the response as a character stream decoded with the charset
of the Content-Type header.
|
void |
close() |
abstract long |
contentLength()
Returns the number of bytes in that will returned by
bytes() , or
byteStream() , or -1 if unknown. |
abstract MediaType |
contentType() |
abstract BufferedSource |
source() |
java.lang.String |
string()
Returns the response as a string decoded with the charset of the
Content-Type header.
|
public abstract MediaType contentType()
public abstract long contentLength()
bytes()
, or
byteStream()
, or -1 if unknown.public final java.io.InputStream byteStream()
public abstract BufferedSource source()
public final byte[] bytes() throws java.io.IOException
java.io.IOException
public final java.io.Reader charStream()
public final java.lang.String string() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
Copyright © 2014. All Rights Reserved.