@Contract(threading=IMMUTABLE) public class HeapResourceFactory extends Object implements ResourceFactory
Resource instances stored entirely in heap.| Constructor and Description |
|---|
HeapResourceFactory() |
public Resource generate(String requestId, InputStream inStream, InputLimit limit) throws IOException
ResourceFactoryResource from a given response body.generate in interface ResourceFactoryrequestId - a unique identifier for this particular
response bodyinStream - the original InputStream
containing the response body of the origin HTTP response.limit - maximum number of bytes to consume of the
response body; if this limit is reached before the
response body is fully consumed, mark the limit has
having been reached and return a Resource
containing the data read to that point.Resource containing however much of
the response body was successfully read.IOExceptionpublic Resource copy(String requestId, Resource resource) throws IOException
ResourceFactoryResource.copy in interface ResourceFactoryrequestId - unique identifier provided to associate
with the cloned response body.resource - the original response body to clone.Resource copyIOExceptionCopyright © 1999–2022 The Apache Software Foundation. All rights reserved.