private static class Cache.CacheResponseBody extends ResponseBody
ResponseBody.BomAwareReader| Modifier and Type | Field and Description |
|---|---|
private okio.BufferedSource |
bodySource |
private java.lang.String |
contentLength |
private java.lang.String |
contentType |
(package private) DiskLruCache.Snapshot |
snapshot |
| Constructor and Description |
|---|
CacheResponseBody(DiskLruCache.Snapshot snapshot,
java.lang.String contentType,
java.lang.String contentLength) |
| Modifier and Type | Method and Description |
|---|---|
long |
contentLength()
Returns the number of bytes in that will returned by
ResponseBody.bytes(), or ResponseBody.byteStream(), or
-1 if unknown. |
MediaType |
contentType() |
okio.BufferedSource |
source() |
bytes, byteStream, charStream, close, create, create, create, stringfinal DiskLruCache.Snapshot snapshot
private final okio.BufferedSource bodySource
@Nullable private final java.lang.String contentType
@Nullable private final java.lang.String contentLength
CacheResponseBody(DiskLruCache.Snapshot snapshot, java.lang.String contentType, java.lang.String contentLength)
public MediaType contentType()
contentType in class ResponseBodypublic long contentLength()
ResponseBodyResponseBody.bytes(), or ResponseBody.byteStream(), or
-1 if unknown.contentLength in class ResponseBodypublic okio.BufferedSource source()
source in class ResponseBody