public class ByteArrayCache extends Object
Modifier and Type | Field and Description |
---|---|
static ByteArrayCache |
DEFAULT
Default global byte array cache.
|
Constructor and Description |
---|
ByteArrayCache() |
Modifier and Type | Method and Description |
---|---|
byte[] |
cache(byte[] contents)
Add the specified byte array to this cache.
|
byte[] |
cache(InputStream contents)
Add the specified input stream to this cache.
|
int |
size()
Returns the number of byte arrays in this cache.
|
public static final ByteArrayCache DEFAULT
Note that this can't ever get garbage collected so don't add really large arrays!
public ByteArrayCache()
public byte[] cache(byte[] contents)
contents
- The byte array to add to this cache.public byte[] cache(InputStream contents) throws IOException
contents
- The input stream whose contents are to be added to this cache.IOException
public int size()
Copyright © 2018 Apache. All rights reserved.