@Contract(threading=STATELESS) public class HeapResourceFactory extends Object implements ResourceFactory
Resource
instances stored entirely in heap.Modifier and Type | Field and Description |
---|---|
static HeapResourceFactory |
INSTANCE
Default instance of
HeapResourceFactory . |
Constructor and Description |
---|
HeapResourceFactory() |
Modifier and Type | Method and Description |
---|---|
Resource |
copy(String requestId,
Resource resource)
Deprecated.
Do not use.
|
Resource |
generate(String requestId,
byte[] content)
Creates a
Resource from a given response body. |
Resource |
generate(String requestId,
byte[] content,
int off,
int len)
Creates a
Resource from a given response body. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generate
public static final HeapResourceFactory INSTANCE
HeapResourceFactory
.public Resource generate(String requestId, byte[] content, int off, int len)
ResourceFactory
Resource
from a given response body.generate
in interface ResourceFactory
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.Resource
containing however much of
the response body was successfully read.public Resource generate(String requestId, byte[] content)
ResourceFactory
Resource
from a given response body.generate
in interface ResourceFactory
requestId
- a unique identifier for this particular response body.content
- byte array that represents the origin HTTP response body.Resource
containing however much of
the response body was successfully read.@Deprecated public Resource copy(String requestId, Resource resource) throws ResourceIOException
copy
in interface ResourceFactory
ResourceIOException
Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.