@Contract(threading=IMMUTABLE) public class HeapResource extends Resource
| Constructor and Description |
|---|
HeapResource(byte[] b) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Indicates the system no longer needs to keep this
response body and any system resources associated with
it may be reclaimed.
|
byte[] |
get()
Returns resource content as a byte array.
|
long |
length()
Returns the length in bytes of the response body.
|
String |
toString() |
getInputStreampublic byte[] get()
throws ResourceIOException
ResourcePlease note for memory efficiency some resource implementations may return a reference to the underlying byte array. The returned value should be treated as immutable.
get in class ResourceResourceIOExceptionpublic long length()
Resourcepublic void dispose()
ResourceCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.