public abstract class SniffingResponseBody
extends ResponseBody
Source.
Created by covers1624 on 15/2/21.
| Constructor and Description |
|---|
SniffingResponseBody(ResponseBody parent) |
| Modifier and Type | Method and Description |
|---|---|
long |
contentLength() |
MediaType |
contentType() |
static ResponseBody |
ofFunction(ResponseBody body,
java.util.function.Function<Source,Source> func)
Creates a new
SniffingResponseBody from the given body, with the Source
wrapped using the given Function. |
BufferedSource |
source() |
protected abstract Source |
wrapSource(Source other)
Wrap the given
Source into another Source. |
public static ResponseBody ofFunction(ResponseBody body,
java.util.function.Function<Source,Source> func)
SniffingResponseBody from the given body, with the Source
wrapped using the given Function.body - The body to wrap.func - The Function to wrap the Source.ResponseBody.public long contentLength()
public MediaType contentType()
public BufferedSource source()
protected abstract Source wrapSource(Source other)
Source into another Source.
This is usually performed with something such as ForwardingSourceother - The Source to wrap.