Class HeapResourceFactory
java.lang.Object
org.apache.hc.client5.http.impl.cache.HeapResourceFactory
- All Implemented Interfaces:
ResourceFactory
@Contract(threading=STATELESS)
public class HeapResourceFactory
extends Object
implements ResourceFactory
Generates
Resource instances stored entirely in heap.- Since:
- 4.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HeapResourceFactoryDefault instance ofHeapResourceFactory. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResourceFactory
generate
-
Field Details
-
INSTANCE
Default instance ofHeapResourceFactory.
-
-
Constructor Details
-
HeapResourceFactory
public HeapResourceFactory()
-
-
Method Details
-
generate
Description copied from interface:ResourceFactoryCreates aResourcefrom a given response body.- Specified by:
generatein interfaceResourceFactory- Parameters:
requestId- a unique identifier for this particular response body.content- byte array that represents the origin HTTP response body.off- the start offset in the array.len- the number of bytes to read from the array.- Returns:
- a
Resourcecontaining however much of the response body was successfully read.
-
generate
Description copied from interface:ResourceFactoryCreates aResourcefrom a given response body.- Specified by:
generatein interfaceResourceFactory- Parameters:
requestId- a unique identifier for this particular response body.content- byte array that represents the origin HTTP response body.- Returns:
- a
Resourcecontaining however much of the response body was successfully read.
-
copy
Deprecated.Do not use.- Specified by:
copyin interfaceResourceFactory- Throws:
ResourceIOException
-