Code example for CacheRequest

Methods: getBody

0
    AbstractHttpInputStream(InputStream in, HttpEngine httpEngine,
            CacheRequest cacheRequest) throws IOException {
        this.in = in;
        this.httpEngine = httpEngine;
 
        OutputStream cacheBody = cacheRequest != null ? cacheRequest.getBody() : null;
 
        // some apps return a null body; for compatibility we treat that like a null cache request 
        if (cacheBody == null) {
            cacheRequest = null;
        } 
 
        this.cacheBody = cacheBody;
        this.cacheRequest = cacheRequest;
    } 
 
    /** 
     * read() is implemented using read(byte[], int, int) so subclasses only 
     * need to override the latter. 
     */