@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() |
getInputStream
public byte[] get() throws ResourceIOException
Resource
Please 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 Resource
ResourceIOException
public long length()
Resource
public void dispose()
Resource
Copyright © 2010–2021 The Apache Software Foundation. All rights reserved.